Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
Hyperlink in cells....how to activate it with out a mouse | Excel Discussion (Misc queries) | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Activate cell at end of range | Setting up and Configuration of Excel | |||
How do I de-activate hyperlink in Excel ? | New Users to Excel |