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
|