copy autofilter values if not empty

confused in Frankfurt

Board Regular
Joined
Oct 11, 2010
Messages
53
Hi

i need help with a small problem.

have a thread which filters a dataset to show a criteria

wanted to use
ActiveCell.Offset(1, 0).Activate
ActiveCell.Select

If Not IsEmpty(Range(Selection).Value) Then
.....
end if

to determine whether there are any values returned using the autofilter before copying and pasting to skip this procedure to move on to the next if values not available.

The offset always moves from the titles row to the next row (not shown in the autofilter selection) ie header in row 3 then always shows row 4 even if the autofilter next row is 50.

How do I check if there are any values being shown in the autofilter with the desired criteria and skip if no values??

regards
Sarah:confused:
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try something like this:
Code:
Dim x As Long
x = WorksheetFunction.Subtotal(3, Range("your range here"))
If x > 0 Then
'rest of your code here
where your range is the unfiltered range.
 
Upvote 0

Forum statistics

Threads
1,223,250
Messages
6,171,036
Members
452,374
Latest member
keccles

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