I am trying to copy a range of data from one worksheet to another. The range is defined by the value in the A column matching a set value. I have been able to add each of the cells with the specified value into a range object, but I now have to select all the data in the rows of the cells which are in my range object in order to copy them to another sheet. Any advice?
Also, I am very new to VBA so I am sure my code formatting is terrible, but I really just need a solution to this particular problem. Thanks for the help!
Dim allAsNum As Range
Dim currAsNum As Range
Dim asnum
Dim j
Sheets("Full Log").Select
asnum = "searchingvalue"
For j = 2 To CInt(Cells(Rows.Count, "A").End(xlUp).Row)
If Range(Sheets("Full Log").Cells.Address).Cells(j, 1).Value = asnum Then
If allAsNum Is Nothing Then
Set allAsNum = Range(Sheets("Full Log").Cells.Address).Cells(j, 1)
Else
Set allAsNum = Union(allAsNum, Range(Sheets("Full Log").Cells.Address).Cells(j, 1))
End If
End If
Next j
Set currAsNum = allAsNum.Rows 'This is the line that I can't figure out
currAsNum.Select