Copy, paste, move on

WireGuy8

New Member
Joined
Feb 7, 2022
Messages
18
I have a range that is being filtered. Once filtered, if there is data, that data needs to be copied and then pasted into another sheet. If the data is filtered and the rows are blank, then do not copy and move on to the next command. How can I do this, below if my coding.

sheet10.Activate
With Range("Q1")
If .Value = "" Then
Range("D3:D202").AutoFilter 4, "", xlAnd, "<>"
Else
Range("D3:D202").AutoFilter 4, "*" & .Value & "*"
End If
End With

With sheet10
If Columns(2).SpecialCells(xlVisible).Rows.Count = 1 Then Exit Sub
AutoFilter.Range.Offset(1).Columns("C").Copy
sheet3.Range("D94").PasteSpecial xlPasteValues
.AutoFilter.Range.Offset(1).Columns("R").Copy
sheet3.Range("I94").PasteSpecial xlPasteValues
.AutoFilter.Range.Offset(1).Columns("Q").Copy
sheet3.Range("F94").PasteSpecial xlPasteValues
End With
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top