Excel VBA trying to loop through rows in a named range
Experts,
When you see my file, you will know right away that I am clueless when it comes to using VBA in Excel.
I created a macro that goes out to a website and looks up a small amount of data for one golfer. Now I am trying to figure out how to do this for all golfers in a table. If I could figure out how to loop through all users I would then have to figure out to have the data pasted below the previous golfers data. The data for each golfer should span 3 rows. So, I need to be able to go down 3 or 4 rows before pasting the next golfer.
Ok, I think I've added that part correctly, but can't be sure until I get everything else fixed.
Each time the loop runs I need a url inserted. The only thing different each time is the value in the third column of the named range needs to be inserted in the middle.
Here's how I am trying to do that:
Dim String1 As StringDim String2 As StringString1 = "URL;http://widgets.ghin.com/HandicapLookupResults.aspx?entry=1&dynamic=&small=0&css=default&ghinno="String2 = "hidename=0&showmsg=0&showheader=1&showtabheader=0&combinehieff=0&showheadertext=1&showfootertext=1&tab=2"String1&rngRow.Columns(3).Value&String2
Wow. It looks like we are really close. The only thing left to figure out is to have the loop drop down 3 cells each time through. Currently it is overwriting the previous loops results each time. I have a line in there that says: Destination:=Range("$A$1")). How would I make it drop down 3 cells each time?
Dale Logan
ASKER
Got it figured out. Thanks so much for your help.
Martin Liss
You're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
Each time the loop runs I need a url inserted. The only thing different each time is the value in the third column of the named range needs to be inserted in the middle.
Here's how I am trying to do that:
Open in new window