Going down a line in Excel VBA

Closed
mndude Posts 2 Registration date Friday January 15, 2016 Status Member Last seen January 15, 2016 - Jan 15, 2016 at 03:28 PM
 Blocked Profile - Jan 15, 2016 at 04:57 PM
I'm trying to write a simple Excel macro that will basically click on hyperlinks within the cells, but I don't know how to have it go down to the next line automatically. Here is what I currently have:

"Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("E4").Select
Application.Wait Now + TimeValue("00:00:20")
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("E5").Select
Application.Wait Now + TimeValue("00:00:20")
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("E6").Select
Application.Wait Now + TimeValue("00:00:20")
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("E7").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Range("E8").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True"

As there'll be thousands of lines to go down to, I would like to have it just go to the next line without having to write thousands of lines of code like this. How should I type this?
Related:

1 response

Blocked Profile
Jan 15, 2016 at 04:57 PM
A FOR loop will accomplish this!
1