A little Macro Help Please ...
how to do this will depend upon how your data is arranged... on one sheet?
on mutiple sheets?
you can turn the AutoFilter for a given sheet off again by adding
Selection.Autofilter
to the end of your code... that flips whether it's on... if it's on, it
turns it off, if it's off, it turns it on.
If you need to have your code check if an AutoFilter mode is on, and turn it
on or off, you can do it like this:
If ActiveSheet.AutoFilterMode = True Then
Selection.AutoFilter
End If
That would turn the AutoFilter off, if it were on. Change the True to
False, if you need it to turn it on, if it's off.
You didn't mention how your data is arranged, one sheet, or multiples... but
if it's a series of sheets that you need to perform this same check on, it
would go something like this:
Dim i as integer
For i = 1 to ActiveWorkbook.Shets.Count Step 1
Sheets(i).Activate
'The rest of your code that we've been discussing here
Next i
That will loop through every sheet in the workbook, performing the same check.
If your data is arranged in another manner, you'd need to edit it
appropriately.
|