PC Review


Reply
Thread Tools Rate Thread

cutting and pasting data within a worksheet, from one sheet toanother, using selection criteria

 
 
Beancounter
Guest
Posts: n/a
 
      22nd Feb 2010
I want to cut and paste a line of date (a whole row) from one
worksheet to another based upon a certain criteria.

For example, I have Sheet-A containing 5 columns, the first (a)
contains a part number that is repeated, I want to pull any line that
contains a certain part number over to a new Sheet – B. Last but not
least, delete the rows in the original file containing the part
number.

Thanks in advance.
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      22nd Feb 2010
Give this a try:


Sub moveStuff()
Dim lr As Long, sh As Worksheet, myPN As String
Set sh = ActiveSheet 'Change to actual Sheet
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
myPN = InputBox("Enter Part Number to Search")
For i = lr To 2 Step -1
If Range("A" & i).Value = myPN Then
Range("A" & i).EntireRow.Copy
Sheets(2).Range("A2").Insert
End If
Next
End Sub




"Beancounter" <(E-Mail Removed)> wrote in message
news:04ee0026-b9a2-4709-bef2-(E-Mail Removed)...
I want to cut and paste a line of date (a whole row) from one
worksheet to another based upon a certain criteria.

For example, I have Sheet-A containing 5 columns, the first (a)
contains a part number that is repeated, I want to pull any line that
contains a certain part number over to a new Sheet – B. Last but not
least, delete the rows in the original file containing the part
number.

Thanks in advance.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel -- Cutting and Pasting Certain Values from a Column to another Sheet? billywilliamson Microsoft Excel Programming 0 21st Dec 2010 11:44 PM
Problem Cutting and Pasting from SQL Table to Excel Sheet Chaplain Doug Microsoft Excel Misc 0 25th Apr 2008 04:55 PM
cutting and pasting rows from one sheet to another generates error =?Utf-8?B?SlQgU3BpdHo=?= Microsoft Excel Misc 7 14th Feb 2006 07:06 PM
Copy and pasting specific sheet data to a master worksheet simora Microsoft Excel Programming 4 9th May 2005 05:30 AM
Cutting, copying, and pasting my selection andycharger Microsoft Excel Programming 1 2nd Dec 2003 12:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:14 AM.