gaidensensei
Banned
- May 31, 2003
- 2,851
- 2
- 81
Yeah.. doing some tax filing. Can't believe I missed this thread all week. Anyone here use paypal with some small business?
I've been trying to work on a script the past few years in excel and tweak it for my likes using Excel's macro function and comma separated value sheets downloaded from paypal history.
So far it works ok the past few years, but I need to run it multiple times, each time changing the field I want to copy / sort. And it's case sensitive too.
Here's in advance if anyone wants to give suggestions.
I've been trying to work on a script the past few years in excel and tweak it for my likes using Excel's macro function and comma separated value sheets downloaded from paypal history.
So far it works ok the past few years, but I need to run it multiple times, each time changing the field I want to copy / sort. And it's case sensitive too.
Here's in advance if anyone wants to give suggestions.
Code:
Sub ExcelFilter()
Dim LSearchRow As Integer
Dim LCopyToRow As Integer
On Error GoTo Err_Execute
'Start search in row 1
LSearchRow = 1
'Start copying data to row 1 in Sent (row counter variable)
LCopyToRow = 2
While Len(Range("A" & CStr(LSearchRow)).Value) > 0
'Enter the status/transaction type here, case sensitive and needs exact
If Range("C" & CStr(LSearchRow)).Value = "eBay Payment Received" Then
'Selects row in first original sheet to copy
Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
Selection.Copy
'Paste row into the new sheet name
Sheets("paymentreceived").Select
Rows(CStr(LCopyToRow) & ":" & CStr(LCopyToRow)).Select
ActiveSheet.Paste
'Move counter to next row
LCopyToRow = LCopyToRow + 1
'Go back to original sheet to continue searching
Sheets("filename").Select
End If
LSearchRow = LSearchRow + 1
Wend
'Position on cell A3
Application.CutCopyMode = False
Range("A3").Select
MsgBox "Data has been copied."
Exit Sub
Err_Execute:
MsgBox "An error occurred."
End Sub
Last edited: