Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I am trying to Copy the results of a filter into a separate worksheet, but have found that it is copying the occupied cells, plus all of the blank ones below. I don't know how to only select the occupied cells, so I have selected rows 2 - 1001. The formula I am using is below: Sub SecondStep() ' ' SecondStep Macro ' Macro recorded 18/02/2004 by Andy ' Sheets("Raw Data").Activate Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:="PB to Cust*" Range("A2:F1001").Select Selection.Copy Sheets("CustbyRDC").Select Range("A7").Select ActiveSheet.Paste Sheets("Raw Data").Select ' End Sub Please help!! I am at the end of my tether!! Thanks in advance Andy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andy,
Replace Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:="PB to Cust*" Range("A2:F1001").Select Selection.Copy with With Range("A2").CurrentRegion .AutoFilter Field:=2, Criteria1:="13" .SpecialCells(xlVisible).Copy .Copy End With HTH, Bernie MS Excel MVP "Andy W" wrote in message ... Hi All, I am trying to Copy the results of a filter into a separate worksheet, but have found that it is copying the occupied cells, plus all of the blank ones below. I don't know how to only select the occupied cells, so I have selected rows 2 - 1001. The formula I am using is below: Sub SecondStep() ' ' SecondStep Macro ' Macro recorded 18/02/2004 by Andy ' Sheets("Raw Data").Activate Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:="PB to Cust*" Range("A2:F1001").Select Selection.Copy Sheets("CustbyRDC").Select Range("A7").Select ActiveSheet.Paste Sheets("Raw Data").Select ' End Sub Please help!! I am at the end of my tether!! Thanks in advance Andy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro - copy and paste value | Excel Discussion (Misc queries) | |||
MSExcel 2007 Filters do not allow Copy and Paste of data | Excel Discussion (Misc queries) | |||
Copy/paste with filters from one sheet to another? | Excel Discussion (Misc queries) | |||
How to copy with filters but not copy the filters in the middle? | Excel Discussion (Misc queries) | |||
Macro to copy and paste | Excel Programming |