Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I am having trouble with removing some data before inserting it into a pivot table. In column g of my excel database, i have shift -trip numbers in the following format XXXXXXX-X. Where all X's are numbers. My issue is that I need to find all shift-trip numbers that end in -1 and copy and paste them to a new page, these are the entries I need for further analysis. Any ideas on how to recognize the end "-1"? I am not having luck with anything I've seen online so far, though I am very new to vb. Thanks in advance, Kyle |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kyle,
Not sure which 5 columns for want, or where you want the cells copied, but code like this will do it. I assumed that your database sheet is Sheet1, and you are copying to Sheet2 to the bottom of column A, and you want column G, H, I, J, and K copied. Dim myR As Range Set myR = Intersect(Worksheets("Sheet1").Range("G:G"), _ Worksheets("Sheet1").UsedRange) myR.AutoFilter Field:=1, Criteria1:="=*-1" myR.Offset(1, 0).Resize(myR.Rows.Count - 1, 5). _ SpecialCells(xlCellTypeVisible).Copy _ Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp)(2) myR.AutoFilter Application.CutCopyMode = False HTH, Bernie MS Excel MVP wrote in message ... Hi all, I am having trouble with removing some data before inserting it into a pivot table. In column g of my excel database, i have shift -trip numbers in the following format XXXXXXX-X. Where all X's are numbers. My issue is that I need to find all shift-trip numbers that end in -1 and copy and paste them to a new page, these are the entries I need for further analysis. Any ideas on how to recognize the end "-1"? I am not having luck with anything I've seen online so far, though I am very new to vb. Thanks in advance, Kyle |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Copy and Paste | New Users to Excel | |||
Find/Copy/paste.. then Find/Paste - not working ... at all.... | Excel Programming | |||
Find, copy and paste | Excel Discussion (Misc queries) | |||
Find Copy and Paste | Excel Programming |