I have a worksheet (#1) containing a list of row numbers that correspond to worksheet #2. There are about 650 rows that I need to select in worksheet #2 (out of a total of 11,000ish rows in worksheet #2).
I got as far as making this little vba script
Sub SelectRows()
Dim wb1 As Workbook, wb2 As Workbook
Dim ws1 As Worksheet, ws2 As Worksheet
Set wb1 = Workbooks("worksheet1")
Set wb2 = Workbooks("woorksheet2")
Set ws1 = wb1.Sheets("Sheet1")
Set ws2 = wb2.Sheets("Sheet2")
For Each Row In ws1.Range("A1:A650").Cells
ws2.Rows(Row).Select
Next
End Sub
The problem I run into, is that after the script runs, it will only have selected the very last row# from worksheet#1.
so if worksheet#1 looks like this...
1
6
100
...
5670
I am only able to select row 5670 on worksheet#2 after running my program.
How can I tell VBA that I want to continually add to my selection instead of just re-selecting the next row?
EDIT For those who are unclear..
I have a large spreadsheet containing over 11,000 rows of data. I need to select around 600 rows from this spreadsheet. However, I only know the row# of the data that I need to select from this spreadsheet.
So, I have created a second spreadsheet that lists in A1:A600 the row numbers that I need to select in my aforementioned spreadsheet.
Yes, this is a terrible way to do things. Yes, if there was any other way of selecting data other then row#, I would do it. Simply put, in my situation, there is not. If you do not believe I have been trying to solve this problem all day, that is fine, you may downvote this question.