where is the mistake?

anilg0001

Rules Violation
Joined
Jun 7, 2010
Messages
193
Range("A1").Select
l = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
For l = l To 1 Step -1
With Range("A" & i)
Selection.Hyperlinks(1).Follow
End With
Next l

in my excel a1 to a20 have hyperlink
i want to open all the web pages at the same time
a1 t0 a20 is not constant
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
You aren't selecting it. just remove the selection and you should be OK

Try this:
Code:
l = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
For l = l To 1 Step -1
With Range("A" & i)
    .Hyperlinks(1).Follow
End With
Next l

Cheers

Dan
 
Upvote 0
Typo: i should be l:

You aren't selecting it. just remove the selection and you should be OK

Try this:
Rich (BB code):
l = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
For l = l To 1 Step -1
With Range("A" & l)
    .Hyperlinks(1).Follow
End With
Next l

Cheers

Dan
 
Upvote 0
yes i got the error
it is in the

With Range("A" & i)
it is not i and it is l

ok
but only one url is opend
i want to open all the urls from a range
how is that?
</pre>
 
Upvote 0
Maybe this?

Code:
For l = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
    Range("A" & l).Hyperlinks(1).Follow True
Next l

The True tells it to open in a new window. Otherwise it is opening them all but one after the other in the same window.

Also removed a bunch of code that was not needed.
 
Last edited:
Upvote 0
a1 cells url was only opened
why not open a2 to a20 cells urls

I edited my post, grab the new code:

Code:
For l = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
    Range("A" & l).Hyperlinks(1).Follow True
Next l

and report back

Cheers

Dan
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top