Hi all,
I am new to creating macros and have gotten a little ways with this one, but having problems knowing how to advance to the next row/cell.
I need a macro that will copy a URL from one cell, then use it to create a hyperlink in another cell.
So far, I have this to start with (I recorded copying the URL from J2 and pasting it into the ADD HYPERLINK function for cell I2:
Range("J2").Select
ActiveCell.Copy
Range("I2").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GRid=62927511"
What I need is a way to loop this from J2/I2 through J730/I730, with column I containing unique URL addresses, so rather than the macro specifying the data to add, I want it to just paste what it copied from each cell in column J. I would also like it to skip to the next J cell if the current J cell is null. So it would be something like:
Select J cell
If not null, Copy contents
Select I cell
Select Hyperlink, paste contents into address
Select next sequential J cell
If not null, Copy Contents...
Select next I cell
etc...
The macro should only copy/paste when J cell is not null, and it should paste to the same row I cell (if J20 not null, copy to I20 hyperlink address, skip null J21, if J22 not null, copy to I22 hyperlink address...etc...)
Hope I've made this clear enough.
Any takers? Sure appreciate any assistance I can get with this. It will take me forever to do this by hand.
Bookmarks