Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default 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
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
Insert hyperlink ini Excel Kay Excel Discussion (Misc queries) 1 July 23rd 09 08:30 PM
Hyperlink Insert Pane (Last used) Andre Excel Discussion (Misc queries) 0 November 30th 06 09:04 AM
How do I insert the value of a cell into a Hyperlink CW2 James Reed Excel Discussion (Misc queries) 1 March 4th 06 04:25 PM
insert hyperlink Gary''s Student Excel Discussion (Misc queries) 0 November 19th 05 02:13 PM
Insert hyperlink Todd Huttenstine Excel Programming 1 November 1st 04 12:26 AM


All times are GMT +1. The time now is 01:40 AM.

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

About Us

"It's about Microsoft Excel"