Good afternoon all,
I'm new to vb and I'm having a problem with a user request. I have created a macro that builds a spreadsheet that I need to manipulate a little bit. For every record in the worksheet that has revenue (column f) = zero, I need to move that record (row) to the bottom. I want to do this for every record that meets that criteria.
I have the following code (which I believe works) to select and cut the data I need; it's the moving and shifting of the data that I'm stuck on:
' Select records with ZERO revenue and move them to the end
raddr = "a2:j"
Range("f:f").Se lect
Selection.AutoF ilter Field:=1, Criteria1:="0.0 0"
Selection.Speci alCells(xlCellT ypeLastCell).Se lect
xrow = ActiveCell.Row
raddr = raddr + xrow
Range(raddr).Se lect
Selection.Cut
Selection.AutoF ilter
What is the easiest way to accomplish this? Thanks VERY MUCH for your help!
mikechance812
I'm new to vb and I'm having a problem with a user request. I have created a macro that builds a spreadsheet that I need to manipulate a little bit. For every record in the worksheet that has revenue (column f) = zero, I need to move that record (row) to the bottom. I want to do this for every record that meets that criteria.
I have the following code (which I believe works) to select and cut the data I need; it's the moving and shifting of the data that I'm stuck on:
' Select records with ZERO revenue and move them to the end
raddr = "a2:j"
Range("f:f").Se lect
Selection.AutoF ilter Field:=1, Criteria1:="0.0 0"
Selection.Speci alCells(xlCellT ypeLastCell).Se lect
xrow = ActiveCell.Row
raddr = raddr + xrow
Range(raddr).Se lect
Selection.Cut
Selection.AutoF ilter
What is the easiest way to accomplish this? Thanks VERY MUCH for your help!
mikechance812
Comment