Bill_Biggs
Well-known Member
- Joined
- Feb 6, 2007
- Messages
- 1,216
I got this macro from a board member earlier. It works well
<font face=Courier New><SPAN style="color:#00007F">Dim</SPAN> cell <SPAN style="color:#00007F">As</SPAN> Range<br><SPAN style="color:#00007F">Dim</SPAN> rng <SPAN style="color:#00007F">As</SPAN> Range<br><SPAN style="color:#00007F">Dim</SPAN> ws <SPAN style="color:#00007F">As</SPAN> String: ws = ActiveSheet.Name<br><SPAN style="color:#00007F">Set</SPAN> rng = Range("C3:E6, C9:E12")<br><SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> cell <SPAN style="color:#00007F">In</SPAN> rng<br>Range(cell.Value).Select<br><SPAN style="color:#007F00">'Execute Procedure</SPAN><br><SPAN style="color:#00007F">Next</SPAN> cell<br></FONT>
What I would like to do now is reference a second range in the same macro and have the cell value transferred to the second range, again one cell at a time. Basically, it will go something like this:
1st Range ( list of sheet coordinates)
Gather first coordinate
Go to sheet and cell
Execute procedure
Goto Second Range (another list of coordinates)
Goto sheet and cell
Execute procedure
Go back to first Range
Gather second coordinates
etc..... through all 357 cells in the first range.
I am not sure how to reference the second range and cells.
Thank you,
<font face=Courier New><SPAN style="color:#00007F">Dim</SPAN> cell <SPAN style="color:#00007F">As</SPAN> Range<br><SPAN style="color:#00007F">Dim</SPAN> rng <SPAN style="color:#00007F">As</SPAN> Range<br><SPAN style="color:#00007F">Dim</SPAN> ws <SPAN style="color:#00007F">As</SPAN> String: ws = ActiveSheet.Name<br><SPAN style="color:#00007F">Set</SPAN> rng = Range("C3:E6, C9:E12")<br><SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> cell <SPAN style="color:#00007F">In</SPAN> rng<br>Range(cell.Value).Select<br><SPAN style="color:#007F00">'Execute Procedure</SPAN><br><SPAN style="color:#00007F">Next</SPAN> cell<br></FONT>
What I would like to do now is reference a second range in the same macro and have the cell value transferred to the second range, again one cell at a time. Basically, it will go something like this:
1st Range ( list of sheet coordinates)
Gather first coordinate
Go to sheet and cell
Execute procedure
Goto Second Range (another list of coordinates)
Goto sheet and cell
Execute procedure
Go back to first Range
Gather second coordinates
etc..... through all 357 cells in the first range.
I am not sure how to reference the second range and cells.
Thank you,
Last edited: