I need to copy the serial numbers and amounts from each row in a very large amount of data (4000 lines and growing daily) that match a user defined month and account number (Fill in a box that appears over screen - like a message box). Then paste that data into a new workbook in a new file and save using a set file name based on the account and month used.
This has taken me days to work out, and it only finds the account and pastes the whole line to a new sheet in the same workbook.......
I need some help.......
Sub NewSheetData()
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
Dim Rng As Range
Set Rng = Range([A1], Range("A" & Rows.Count).End(xlUp))
On Error Resume Next
With Rng
.AutoFilter , field:=1, Criteria1:="4564"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Sheet2").Range("A1")
.AutoFilter
End With
On Error GoTo 0
Application.EnableEvents = True
End Sub
Account Date Amount Serial
4564 01/04/2010 90.00 23456
4578 01/04/2010 95.00 24186
4578 02/04/2010 60.00 24916
4578 02/04/2010 71.00 25646
4564 03/04/2010 43.00 27106
4582 03/04/2010 69.00 26376
4536 04/04/2010 78.00 27836
4578 04/04/2010 45.00 28566
4578 05/04/2010 40.00 29296
4582 05/04/2010 99.00 30026
4536 06/04/2010 45.00 31486
4578 06/04/2010 60.00 30756
4564 07/04/2010 36.00 32216
4564 07/04/2010 82.00 32946
4578 08/04/2010 66.00 33676
4578 08/04/2010 49.00 34406
4582 09/04/2010 53.00 35136
4582 09/04/2010 76.00 35866
4536 10/04/2010 3.00 36596
Thanks Mike
Bookmarks