Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pasting Data into a worksheet
I am using the below to search, copy + paste data into a
worksheet. The code finds the results OK, but isn't pasting anything, and just jumping straight into the MsgBox. Any ideas what I've done wrong anyone?? Sub BBBBB() Dim rng As Range Dim bCopy As Boolean Sheets("Raw Data").Activate If ActiveSheet.AutoFilterMode Then _ ActiveSheet.AutoFilterMode = False With Range("A1") .AutoFilter Field:=2, Criteria1:="=*Z*" End With With ActiveSheet.AutoFilter.Range Set rng = .Offset(1, 0).Resize(.Rows.Count - 1) bCopy = False If .SpecialCells(xlVisible).Columns(1) _ .Rows.Count 1 Then _ bCopy = True End With If bCopy Then rng.Copy Destination:=Sheets("CustbyRDC").Range("A7") Else MsgBox "No rows to copy" End If ActiveSheet.AutoFilterMode = False End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying data from 1 worksheet and pasting to another skipping blan | Excel Discussion (Misc queries) | |||
Is there a way to prevent pasting data into an Excel worksheet? | Excel Worksheet Functions | |||
Pasting on Filtered Data Sheets without pasting onto hidden cells | Excel Discussion (Misc queries) | |||
Automatically pasting worksheet data to new worksheet with formulas | Excel Worksheet Functions | |||
Pasting data without the worksheet automatically delimiting it? | Excel Discussion (Misc queries) |