Hi all,
I need a macro that can look through a table of data, select certain rows and copy them to another sheet.
It needs to look in column A and where it finds "1" then select the entire row then copy all selected.
Any ideas?
Thanks,
LVall
Hi all,
I need a macro that can look through a table of data, select certain rows and copy them to another sheet.
It needs to look in column A and where it finds "1" then select the entire row then copy all selected.
Any ideas?
Thanks,
LVall
Hi LVall and welcome to the forum,
This problem takes me about 5 minutes to write the macro and post it back to you. It is easier if you supply a sample of what you data looks like. To attach a sample, click on "Go Advanced" and then the paper clip icon above the advanced message box. You give us the sample we spend 5 minutes to give back the VBA.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
My work internet seems to block the attachment page. I've gotten somewhere with the VBA but it's only partially there. I've got this:
Sub MultiTestNew()
Dim Rng As Range, Cell As Range
Set Rng = Range(Range("AJ2"), Range("AJ" & Rows.Count).End(xlUp))
For Each Cell In Rng
If Cell = "1" Then
Cell.EntireRow.Select
End If
Next Cell
End Sub
I've adapted it from somewhere else and it selects the correct rows I need but it selects them one at a time. I need it to select all rows where Column AJ = 1 and then copy them. Can you adapt the above VBA?
Thanks
Maybe:
Copies to Sheet2.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks