Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If X in Col B Then Copy, Paste & Delete

Status
Not open for further replies.
Oct 23, 2007
36
US
I am not really good at Vb and I have seen several threads that are close to my question but I still can't figure it out, so I'll go ahead and appoligize if this is a dup post.

I have 2 sheets in my work book and Based on Sheet 1 if there is an X in Col B I need it to Copy and Paste that row into Sheet2, then Delete the entire row from Sheet1 where X was.

Here is where I can't figure it out, There may already be some things posted in Sheet2 so I need it to find the first emtpy row in Sheet2 then paste there. Then I need it to keep looping and delete all rows with an X.

Thanks
 
No need to loop!!

Looping is inefficient and wastes time in situations like this.

Turn on you macro recorder, then do an AutoFilter for X in column B. Copy all visible populated rows, paste to the end of Sheet2.

To find the final row on each sheet, see
[tab]faq707-2115
or
[tab]faq707-2112


[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top