Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Activate Hyperlink in Named Range

I have Hperlinks to sheets in column A and numbers corresponding to the
location in Column B.
I have three seperate sections of locations in column A that I've given a
Range Name because some of the numbers are duplicates between the sections.
I need to search, by section/named Range for the number in Column B, and if
the number is found, activate the corresponding hyperlink in Column A.
I tried using a macro to determine the physical row number within the named
range, but it failed.
I really need to get this fixed. Can anyone help?
I've set up a Range OHAC using Insert/Name/Define with Offset/CountA (as the
range will change!) starting at A32 counta A32:A44. The numbers are in Column
B.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Activate Hyperlink in Named Range

In this sub, I have defined block1 to be some part of column B (the search
column). You can use as many blocks as you want. We search for a value, say
101. Once found, we get the hyperlink into a string variable and then
activate it.


Sub david()
Dim r As Range
For Each r In Range("block1")
If r.Value = 101 Then
s = r.Offset(0, -1).Value
ActiveWorkbook.FollowHyperlink Address:=s
Exit Sub
End If
Next
End Sub


So its really three steps:

1. find the number
2. get the link
3. follow the link
--
Gary''s Student - gsnu200719
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Activate Hyperlink in Named Range

Tell Gary you get a B+ :)

Here's the code, starting with yours, that finally worked. Thanks
much...great help!

For Each r In Range("OHACFN")
If r.Value = iOffice Then
's = r.Offset(0, -1).Value
r.Offset(0, -1).Select
'ActiveWorkbook.FollowHyperlink Address:=s
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Application.CommandBars("Task Pane").Visible = False
Exit Sub
End If
Next r

"Gary''s Student" wrote:

In this sub, I have defined block1 to be some part of column B (the search
column). You can use as many blocks as you want. We search for a value, say
101. Once found, we get the hyperlink into a string variable and then
activate it.


Sub david()
Dim r As Range
For Each r In Range("block1")
If r.Value = 101 Then
s = r.Offset(0, -1).Value
ActiveWorkbook.FollowHyperlink Address:=s
Exit Sub
End If
Next
End Sub


So its really three steps:

1. find the number
2. get the link
3. follow the link
--
Gary''s Student - gsnu200719

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
Hyperlink in cells....how to activate it with out a mouse homer Excel Discussion (Misc queries) 0 November 22nd 06 01:10 AM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM
Activate cell at end of range G Setting up and Configuration of Excel 2 November 22nd 05 04:10 PM
How do I de-activate hyperlink in Excel ? Nik New Users to Excel 2 November 18th 05 02:14 PM


All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"