PDA

View Full Version : [SOLVED:] Shifting rows to a worksheet depending on a cell value



jamesg
09-24-2009, 11:40 PM
Hi All,
Am working in XL03. Am looking for some VB code that will check down a column and where it finds "x" will remove that row and place it into another worksheet. That sheet already has a list (with headings) so the transfered row needs to not overwrite the 1st entry (row2). I am not a VB programer (like nobody could tell), It would be great if this could be pasted into a macro I recorded previously.

Hope somone can help me? : pray2:

Simon Lloyd
09-25-2009, 07:50 AM
James, welcome to the forum, please take the time to discover a bit more of the forum, the Announcements forum is for folk to let others know of some information, i have moved your thread to Excel Help.

Simon Lloyd
09-25-2009, 07:53 AM
Why not post your previously recorded code so we can help you with it, don't forget when posting code to wrap it in code tags by either clicking http://www.vbaexpress.com/forum/images/editor/vba.gif and pasting your code between the tags or highlight all of your code and click http://www.vbaexpress.com/forum/images/editor/vba.gif

mdmackillop
09-25-2009, 07:57 AM
Sub Macro1()
Columns("B:B").AutoFilter Field:=1, Criteria1:="x"
Range("A2:A1000").SpecialCells(xlCellTypeVisible).Copy Sheets(2).Range("B4")
Columns("B:B").AutoFilter
End Sub

jamesg
09-28-2009, 06:01 PM
MD..thanks for that. Unfortunately it crashed my file. I suspect your code was in 07 and I am on 03. No dramas thought, got it all back.

Entries to be moved are in a sheet labelled "Live List".
The destination sheet is labelled "Reversed List"
Neither sheet would ever exceed dimensions of "A1:M3000"
The "x" identifying the rows to be moved is in column "B"
Moved rows should no longer be in the "Live List"

Any help is greatly appreciated.

Simon Lloyd
09-29-2009, 11:49 AM
James, MD's code works fine in xl03, do you have merged cells by any chance?, why not upload a workbook to illustrate your structure and result?