Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use VBA to automate sorting, cutting & pasting in Excel?
I have a list of data (Outstanding Orders to be filled) and I need to cut all
orders for a particular customer and paste them at the end of the list. Can anyone please help me with the code to do this, I am just a novice at VBA - but very keen to learn |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use VBA to automate sorting, cutting & pasting in Excel?
The code below checks column A againstt a customer name and paste the entire
row at the end of the list. Sub cutandpaste() Customer = "ABC" LastRow = Cells(Rows.Count, "A").End(xlUp).Row RowCount = 1 For LoopCounter = 1 To LastRow If Cells(RowCount, "A").Value = Customer Then Rows(RowCount).Cut Destination:=Rows(LastRow + 1) Rows(RowCount).Delete Else RowCount = RowCount + 1 End If Next LoopCounter End Sub "FredB" wrote: I have a list of data (Outstanding Orders to be filled) and I need to cut all orders for a particular customer and paste them at the end of the list. Can anyone please help me with the code to do this, I am just a novice at VBA - but very keen to learn |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use VBA to automate sorting, cutting & pasting in Excel
Thanks Joel
It works a treat! "Joel" wrote: The code below checks column A againstt a customer name and paste the entire row at the end of the list. Sub cutandpaste() Customer = "ABC" LastRow = Cells(Rows.Count, "A").End(xlUp).Row RowCount = 1 For LoopCounter = 1 To LastRow If Cells(RowCount, "A").Value = Customer Then Rows(RowCount).Cut Destination:=Rows(LastRow + 1) Rows(RowCount).Delete Else RowCount = RowCount + 1 End If Next LoopCounter End Sub "FredB" wrote: I have a list of data (Outstanding Orders to be filled) and I need to cut all orders for a particular customer and paste them at the end of the list. Can anyone please help me with the code to do this, I am just a novice at VBA - but very keen to learn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem Cutting and Pasting from SQL Table to Excel Sheet | Excel Discussion (Misc queries) | |||
Cutting and Pasting in Excel | Excel Discussion (Misc queries) | |||
Cutting/pasting from Excel.Application object - missing the obvious? | Excel Programming | |||
can excel auto correct when cutting and pasting | Excel Discussion (Misc queries) | |||
cutting a row and pasting to a column | Excel Programming |