Mattyastill
New Member
- Joined
- Nov 27, 2017
- Messages
- 23
[COLOR=#BBC0C4 !important][COLOR=#6A737C !important]I currently have multiple sheets for storing records of payments (things to be Pay and CantPay). I am trying to write a macro that will copy and paste Cells A:M on every row where column T = "Resolved" on the CantPay sheet (where the next empty row is the next row where "a" & row-number = blank) to the "Pay" sheet
[/COLOR]
[/COLOR]
Within the sheet which i want to copy from there is data in columns A:T but N:T are not needed once the problem is resolved. So once i have copy and pasted the data within cells A:M i want to just delete the entire row. I have written some code from what i knew and looking online which isn't working. Any help would be much appreciated.
Thanks
I have tried recording a macro and writing my own but it seems the macro i have wrote is deleting row 1 which is where all my column headers are stored.
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Sub MoveToPay()
Dim CantPay As Worksheet:Set CopySheet = Sheets("Can't Pay")
Dim ReadyToPay As Worksheet:Set PasteSheet = Sheets("£ Pay")
Dim lr AsLong
Dim S AsString
Application.ScreenUpdating =False
Columns(20).AutoFilter 1,"Resolved"
With Range("a2", Range("M"& Rows.Count).End(3))
.Copy PasteSheet.Cells(Rows.Count,1).End(3).Offset(1)
.EntireRow.Delete
EndWith
Columns(20).AutoFilter
Application.ScreenUpdating =True
EndSub</code>
[/COLOR]
[/COLOR]
Within the sheet which i want to copy from there is data in columns A:T but N:T are not needed once the problem is resolved. So once i have copy and pasted the data within cells A:M i want to just delete the entire row. I have written some code from what i knew and looking online which isn't working. Any help would be much appreciated.
Thanks
I have tried recording a macro and writing my own but it seems the macro i have wrote is deleting row 1 which is where all my column headers are stored.
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Sub MoveToPay()
Dim CantPay As Worksheet:Set CopySheet = Sheets("Can't Pay")
Dim ReadyToPay As Worksheet:Set PasteSheet = Sheets("£ Pay")
Dim lr AsLong
Dim S AsString
Application.ScreenUpdating =False
Columns(20).AutoFilter 1,"Resolved"
With Range("a2", Range("M"& Rows.Count).End(3))
.Copy PasteSheet.Cells(Rows.Count,1).End(3).Offset(1)
.EntireRow.Delete
EndWith
Columns(20).AutoFilter
Application.ScreenUpdating =True
EndSub</code>