I have a macro where I'm using an autofilter. I use:
'Range(Selection, Selection.End(xlDown)).Select and it works great, except for when it can't find the condition.
If I"m looking for 'Sugar' in the filter and 'Sugar' exists in the data set, the filter pulls all sugar items, copies this data and puts it in another workbood. I use the xlDown and it works. If 'Sugar' does not exist then the filter shows nothing (which is correct) but I want the macro to know that if 'Sugar' doesn't exist then It doesn't need to copy the data into another workbook.
If filter shows nothing then perform action item 1,2,3 and then end. If filter shows items, then do 1,2,3,4,5,6,7, and then end.
With VBA code, how can I check if there is data in the visible cells and if not, then don't copy? (still want to do some steps, but skip steps 4,5,6,7)
I
'Range(Selection, Selection.End(xlDown)).Select and it works great, except for when it can't find the condition.
If I"m looking for 'Sugar' in the filter and 'Sugar' exists in the data set, the filter pulls all sugar items, copies this data and puts it in another workbood. I use the xlDown and it works. If 'Sugar' does not exist then the filter shows nothing (which is correct) but I want the macro to know that if 'Sugar' doesn't exist then It doesn't need to copy the data into another workbook.
If filter shows nothing then perform action item 1,2,3 and then end. If filter shows items, then do 1,2,3,4,5,6,7, and then end.
With VBA code, how can I check if there is data in the visible cells and if not, then don't copy? (still want to do some steps, but skip steps 4,5,6,7)
I