Hi Everyone
I have a macro i have been using for years no problem.
But i would like change it to copy a range of cells instead of whole row.
I have been tying to change it to no success
Please help!
I have a macro i have been using for years no problem.
But i would like change it to copy a range of cells instead of whole row.
I have been tying to change it to no success
Please help!
Code:
Dim LSearchRow As Integer
Dim LCopyToRow As Integer
On Error GoTo Err_Execute
Sheets("SHOP LOAD").Select
'Start search in row 7
LSearchRow = 7
Sheets("SHOP LOAD").Select
'Start copying data to row 2 in Sheet2 (row counter variable)
LCopyToRow = 4
While Len(Range("A" & CStr(LSearchRow)).Value) > 0
'If value in column H = "COMPLETE", copy entire row to April18
If Range("I" & CStr(LSearchRow)).Value = "COMPLETE" Then
'Select row in Sheet to copy
Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
Selection.Copy
'Paste row into April18 in next row
Sheets("April18").Select
LCopyToRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).PasteSpecial xlPasteValues
'Move counter to next row
LCopyToRow = LCopyToRow + 1
'Go back to Sheet2 to continue searching
Sheets("SHOP LOAD").Select
End If
LSearchRow = LSearchRow + 1