bank statement

vac

Board Regular
Joined
May 21, 2002
Messages
211
Hi everyone, this is what Im trying to do.
I download my bank statment into a worksheet.
When the value in a cell in a row is "credit" I want to copy that row into another worksheet on the next available line. When the value is "debit" then I want that row to go to the next available row in a different workheet.
I've done some searching but not found what Im after, I hope someone can help me please.
Many Thanks, vac
ps, has anyone noticed the speed of this forum going very slow, or is it only me today?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

jimboy

Well-known Member
Joined
Apr 11, 2002
Messages
2,314
This will work if there aren't any empty cells in column A.

sub credit_debit ()

Sheets("All").Select
Range("A1").Select

Do Until ActiveCell = Empty
If ActiveCell = "Credit" Then 'case sensitive

ActiveCell.Rows("1:1").EntireRow.Select
Selection.Cut
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Credit").Select
Application.Goto Reference:="R65536C1"
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Sheets("All").Select

Else
If ActiveCell = "Debit" Then 'case sensitive
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Cut
ActiveCell.Offset(1, 0).Range("A1").Select
Sheets("Debit").Select
Application.Goto Reference:="R65536C1"
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Sheets("All").Select
Else

ActiveCell.Offset(1, 0).Range("A1").Select
End If
End If
Loop

End Sub
 

vac

Board Regular
Joined
May 21, 2002
Messages
211
Many Thanks Jimboy, are you always this quick!!, that was excellent, thanks very much
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,099
Messages
5,835,375
Members
430,353
Latest member
GS90

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top