Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Hyperlink
I have a worksheet and I am using code to add some Hyperlinks, I am using
code to add the hyperlink but for some unknown reason it is not entering the sub address correctly, Here is the code maybe someone could point me in the right direction Range("H1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A3:A45", TextToDisplay:="Americas" Range("I1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A47:A89", TextToDisplay:="Asia\Pac" Range("J1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A91:A133", TextToDisplay:="Eur\ROW" Range("K1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A135:A177", TextToDisplay:="Market" Range("L1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A179:A192", TextToDisplay:="Summary" it puts A1 as the Cell Reference Thanks Nigel |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Hyperlink
Try:
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", _ SubAddress:="#Billing!A3:A45", TextToDisplay:="Americas" Did you really want 43 cells selected when you click that link. Nigel wrote: I have a worksheet and I am using code to add some Hyperlinks, I am using code to add the hyperlink but for some unknown reason it is not entering the sub address correctly, Here is the code maybe someone could point me in the right direction Range("H1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A3:A45", TextToDisplay:="Americas" Range("I1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A47:A89", TextToDisplay:="Asia\Pac" Range("J1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A91:A133", TextToDisplay:="Eur\ROW" Range("K1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A135:A177", TextToDisplay:="Market" Range("L1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A179:A192", TextToDisplay:="Summary" it puts A1 as the Cell Reference Thanks Nigel -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Hyperlink
No that doesn't help, I think I read somewhere you can add a hyperlink using
code "Dave Peterson" wrote: Try: ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", _ SubAddress:="#Billing!A3:A45", TextToDisplay:="Americas" Did you really want 43 cells selected when you click that link. Nigel wrote: I have a worksheet and I am using code to add some Hyperlinks, I am using code to add the hyperlink but for some unknown reason it is not entering the sub address correctly, Here is the code maybe someone could point me in the right direction Range("H1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A3:A45", TextToDisplay:="Americas" Range("I1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A47:A89", TextToDisplay:="Asia\Pac" Range("J1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A91:A133", TextToDisplay:="Eur\ROW" Range("K1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A135:A177", TextToDisplay:="Market" Range("L1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A179:A192", TextToDisplay:="Summary" it puts A1 as the Cell Reference Thanks Nigel -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Hyperlink
It worked fine for me.
Did you already have a hyperlink in H1? with activesheet.range("H1") if .hyperlinks.count 0 then .hyperlinks.delete end if .parent.Hyperlinks.Add Anchor:=.cells, Address:="", _ SubAddress:="#Billing!A3:A45", TextToDisplay:="Americas" end with What happened when you tried it? and did you notice the change? I added # in front of "billing". Nigel wrote: No that doesn't help, I think I read somewhere you can add a hyperlink using code "Dave Peterson" wrote: Try: ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", _ SubAddress:="#Billing!A3:A45", TextToDisplay:="Americas" Did you really want 43 cells selected when you click that link. Nigel wrote: I have a worksheet and I am using code to add some Hyperlinks, I am using code to add the hyperlink but for some unknown reason it is not entering the sub address correctly, Here is the code maybe someone could point me in the right direction Range("H1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A3:A45", TextToDisplay:="Americas" Range("I1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A47:A89", TextToDisplay:="Asia\Pac" Range("J1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A91:A133", TextToDisplay:="Eur\ROW" Range("K1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A135:A177", TextToDisplay:="Market" Range("L1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A179:A192", TextToDisplay:="Summary" it puts A1 as the Cell Reference Thanks Nigel -- Dave Peterson -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Hyperlink
I got it to work by naming the range and then it worked fine
thanks for your help "Dave Peterson" wrote: It worked fine for me. Did you already have a hyperlink in H1? with activesheet.range("H1") if .hyperlinks.count 0 then .hyperlinks.delete end if .parent.Hyperlinks.Add Anchor:=.cells, Address:="", _ SubAddress:="#Billing!A3:A45", TextToDisplay:="Americas" end with What happened when you tried it? and did you notice the change? I added # in front of "billing". Nigel wrote: No that doesn't help, I think I read somewhere you can add a hyperlink using code "Dave Peterson" wrote: Try: ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", _ SubAddress:="#Billing!A3:A45", TextToDisplay:="Americas" Did you really want 43 cells selected when you click that link. Nigel wrote: I have a worksheet and I am using code to add some Hyperlinks, I am using code to add the hyperlink but for some unknown reason it is not entering the sub address correctly, Here is the code maybe someone could point me in the right direction Range("H1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A3:A45", TextToDisplay:="Americas" Range("I1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A47:A89", TextToDisplay:="Asia\Pac" Range("J1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A91:A133", TextToDisplay:="Eur\ROW" Range("K1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A135:A177", TextToDisplay:="Market" Range("L1").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:="Billing!A179:A192", TextToDisplay:="Summary" it puts A1 as the Cell Reference Thanks Nigel -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert hyperlink ini Excel | Excel Discussion (Misc queries) | |||
Hyperlink Insert Pane (Last used) | Excel Discussion (Misc queries) | |||
How do I insert the value of a cell into a Hyperlink | Excel Discussion (Misc queries) | |||
insert hyperlink | Excel Discussion (Misc queries) | |||
Insert hyperlink | Excel Programming |