I'm using Excel 2010 in Win XP.
I have a named range that consists of selected concatenated rows from a larger spreadsheet. This list of rows is currently 116 but may increase or decrease based on the source data. I’m okay with this part.</SPAN></SPAN>
I want my macro to go to the first row in the named range, copy it to the clipboard and paste it into a text box on another worksheet within the same workbook. Then I want to repeat this over and over creating another text box and pasting into the new text box until the end of the range. I can get the number of the rows in the range by =ROWS(myRange) in a cell nearby.</SPAN></SPAN>
(The purpose of this for the user to move these text boxes to particular spots on a large graphic map – I’m just trying to make it easier for them to build the text boxes.)</SPAN></SPAN>
So far I have everything working except I cannot find a command that will let me specify the row within the named range except manually as in the first command below.</SPAN></SPAN>
I’ve searched through I lot of reference and I found</SPAN></SPAN>
Application.Goto Reference:=”INDEX(myRange,1)” that looked like it might work but I get errors whenever I try to use a variable in place of the number even though I’ve defined it in my DIM as an Integer and I’ve given it a starting value of 1 (e.g. myindex = 1) and then increment it within a For/Next loop. It seems that this command will not accept a variable there.</SPAN></SPAN>
I’ve also looked at ActiveSheet.Range(“C2”,”D10”).select but that doesn’t really address what I need.</SPAN></SPAN>
I need a command(s) that from within my For/Next will select and copy from within my named range and then increment on the next pass.</SPAN></SPAN>
Any suggestions?</SPAN></SPAN>
I have a named range that consists of selected concatenated rows from a larger spreadsheet. This list of rows is currently 116 but may increase or decrease based on the source data. I’m okay with this part.</SPAN></SPAN>
I want my macro to go to the first row in the named range, copy it to the clipboard and paste it into a text box on another worksheet within the same workbook. Then I want to repeat this over and over creating another text box and pasting into the new text box until the end of the range. I can get the number of the rows in the range by =ROWS(myRange) in a cell nearby.</SPAN></SPAN>
(The purpose of this for the user to move these text boxes to particular spots on a large graphic map – I’m just trying to make it easier for them to build the text boxes.)</SPAN></SPAN>
So far I have everything working except I cannot find a command that will let me specify the row within the named range except manually as in the first command below.</SPAN></SPAN>
I’ve searched through I lot of reference and I found</SPAN></SPAN>
Application.Goto Reference:=”INDEX(myRange,1)” that looked like it might work but I get errors whenever I try to use a variable in place of the number even though I’ve defined it in my DIM as an Integer and I’ve given it a starting value of 1 (e.g. myindex = 1) and then increment it within a For/Next loop. It seems that this command will not accept a variable there.</SPAN></SPAN>
I’ve also looked at ActiveSheet.Range(“C2”,”D10”).select but that doesn’t really address what I need.</SPAN></SPAN>
I need a command(s) that from within my For/Next will select and copy from within my named range and then increment on the next pass.</SPAN></SPAN>
Any suggestions?</SPAN></SPAN>