oleg_v
07-26-2010, 02:54 AM
hi
i have this macro;
Public Sub COPYDT()
Const TEST_COLUMN As String = "Av" '<=== change to suit
Dim i As Long
Dim LastRow As Long
Dim NextRow As Long
NextRow = 4
Dim mnth As Long
With Sheets("oleg")
LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 7 To LastRow
If Mid$(.Cells(i, "Av").Value2, 1, 3) = "1CV" Then
NextRow = NextRow + 1
.Cells(i, "b").Resize(, 47).Copy Worksheets("oleg2").Cells(NextRow, "a")
End If
Next i
End With
End Sub
i was wondering can i add to this macro the month selection where the target columns "au" and sheet"oleg"
know the macro copyes the row that according to the target column all the data with first 3 word is"1cv" i want the macro to copy the row that according to the first target column has first 3 words "1cv" and belongs to particular month that will be imput with the input box by number of the month.
thanks
i have this macro;
Public Sub COPYDT()
Const TEST_COLUMN As String = "Av" '<=== change to suit
Dim i As Long
Dim LastRow As Long
Dim NextRow As Long
NextRow = 4
Dim mnth As Long
With Sheets("oleg")
LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 7 To LastRow
If Mid$(.Cells(i, "Av").Value2, 1, 3) = "1CV" Then
NextRow = NextRow + 1
.Cells(i, "b").Resize(, 47).Copy Worksheets("oleg2").Cells(NextRow, "a")
End If
Next i
End With
End Sub
i was wondering can i add to this macro the month selection where the target columns "au" and sheet"oleg"
know the macro copyes the row that according to the target column all the data with first 3 word is"1cv" i want the macro to copy the row that according to the first target column has first 3 words "1cv" and belongs to particular month that will be imput with the input box by number of the month.
thanks