ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cycle through hyperlinks in column b (https://www.excelbanter.com/excel-programming/431490-cycle-through-hyperlinks-column-b.html)

stevec

cycle through hyperlinks in column b
 
This macro doesn't work. It's supposed to follow the hyperlinks on each row
on columnn b. I get the following error: "Run-time error '9': Subscript
out of range"

any suggestions? thanks...

Sub FollowHyperlinks()
Dim c As Range
For Each c In ActiveSheet.Range("b11:b200")
c.Hyperlinks.Item(1).Follow
Next
End Sub

Gary''s Student

cycle through hyperlinks in column b
 
Your posted code should work if the range is fully packed with hyperlinks.
--
Gary''s Student - gsnu200859


"SteveC" wrote:

This macro doesn't work. It's supposed to follow the hyperlinks on each row
on columnn b. I get the following error: "Run-time error '9': Subscript
out of range"

any suggestions? thanks...

Sub FollowHyperlinks()
Dim c As Range
For Each c In ActiveSheet.Range("b11:b200")
c.Hyperlinks.Item(1).Follow
Next
End Sub


stevec

cycle through hyperlinks in column b
 
thanks gary -- the data in column b are actually formulas that reference
column a:

cell B15: =hyperlink(A15)

data in Column B are actually Internet URLs made with customized concatenate
formuals -- they are orders to a website. I don't want to actually open up a
webpage on my Internet browser, I just want to send the orders to a website.

I thought automaticlly having VBA "click" on hyperlinks in column b would be
the way to do it, but I think I was wrong about that. thanks...

"Gary''s Student" wrote:

Your posted code should work if the range is fully packed with hyperlinks.
--
Gary''s Student - gsnu200859



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com