Hi there, i'm currently using this macro, which is helping me find data in one sheet and copying it to another. However I now need to search for the data across multiple worksheets and then copy it to one worksheet.
Basically, once it's finished searching on the v.sat worksheet, it then moves to the q.sat, neither, q.dis and v.dis worksheets.![]()
Dim LSearchRow As Integer Dim LCopyToRow As Integer Dim LSearchValue As String On Error GoTo Err_Execute LSearchValue = InputBox("Please enter a value to search for.", "Enter value") Sheets("V.Sat").Select Range("A1").Select 'Start search in row 4 LSearchRow = 2 'Start copying data to row 2 in Sheet2 (row counter variable) LCopyToRow = 2 While Len(Range("A" & CStr(LSearchRow)).Value) > 0 'If value in column E = LSearchValue, copy entire row to Sheet2 If Range("E" & CStr(LSearchRow)).Value = LSearchValue Then 'Select row in Sheet1 to copy Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select Selection.Copy 'Paste row into Sheet2 in next row Sheets("Get Info").Select Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select ActiveSheet.Paste 'Move counter to next row LCopyToRow = LCopyToRow + 1 'Go back to Sheet1 to continue searching Sheets("V.Sat").Select End If LSearchRow = LSearchRow + 1 Wend 'Position on cell A3 Application.CutCopyMode = False Range("A3").Select MsgBox "All matching data has been copied."
Any help would be really appreciated.
Bookmarks