Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
cutting and pasting data within a worksheet, from one sheet toanother, using selection criteria
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
cutting and pasting data within a worksheet, from one sheet to another, using selection criteria
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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data Aligning with out cutting and pasting | Excel Worksheet Functions | |||
Problem Cutting and Pasting from SQL Table to Excel Sheet | Excel Discussion (Misc queries) | |||
Data validation vs. cutting pasting | Excel Discussion (Misc queries) | |||
cutting and pasting rows from one sheet to another generates error | Excel Discussion (Misc queries) | |||
Cutting, copying, and pasting my selection | Excel Programming |