Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I am using the code generously supplied by Tom O below, but have found that if a filter returns no result, i.e. if the data doesn't exist in the list, it then proceeds to paste the entire table into the destination worksheet. What I need to happen is if no result is returns, then nothing gets pasted (or a blank row gets pasted). Any ideas? Thanks in advance Andy ;-) Dim rng as Range Sheets("Raw Data").Activate If ActiveSheet.AutofilterMode then Activesheet.AutofilterMode = False With Range("A2") .AutoFilter Field:=2, Criteria1:="PB to Cust*" End with With Activesheet.Autofilter.Range set rng = .offset(1,0).Resize(.rows.count-1) End With rng.copy Destination:=Sheets("CustbyRDC").Range("A7"). if your table actually starts in A1 with a header row, change A2 above to A1. -- Regards, Tom Ogilvy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying rows of data into new worksheet but placing data into colu | Excel Discussion (Misc queries) | |||
Copying worksheet with macro | Excel Discussion (Misc queries) | |||
Copying Data from One Worksheet to Another | Excel Discussion (Misc queries) | |||
Macro for Copying Worksheet to New Workbook | Excel Discussion (Misc queries) | |||
Copying Row Data to Specific Worksheet | Links and Linking in Excel |