statement formula

vac

Board Regular
Joined
May 21, 2002
Messages
211
I'm using this formula to copy entries to another 2 worksheets, with help from jimboy, many thanks. Instead of using the credit/ debit as the key I would like to use the (+ or -) £ or a -£ amount.
eg, if £500 then copy to sheet2, if -£500 then copy to sheet3 etc.
Many thanks
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

vac

Board Regular
Joined
May 21, 2002
Messages
211
Here is the formula, oops!!

Sheets("Sheet2").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("Sheet2").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("Sheet2").Select
Else

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

End Sub
 

Forum statistics

Threads
1,181,241
Messages
5,928,837
Members
436,632
Latest member
DrCSdeLange

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