FILTER - this works for me:
MyTab = ActiveSheet.Name
Set w = Worksheets(MyTab)
'if autofilter is on, it will turn if off otherwise it leaves it on
If w.AutoFilterMode Then
Selection.AutoFilter
End If
PRINT AREA - ROWS:
LASTROW = Cells(Rows.Count, 1).End(xlUp).Row
CONDITIONAL FORMATING:
No specific formual but you could set the conditional formating on an
adjacent cell to set background/forecolor based on the value in the cited
cell.
Glen
"Digory" wrote in message
...
Help for a VBA newbie - I am taking two databases and using filters to
sort and copy data to one of 24 worksheets depending on filter
criteria. Seems to be going ok but would appreciate some advice on
autofilters. Am currently selecting row then turning on autofilter -
however this seems to toggle the filter (if its already on then this
turns it off & vice versa) so if an autofliter has been left on
somewhere in workbook its back to debugger. How do I switch it off
rather than toggle off ?
I am also using this macro to set the print area for each of my 24
worksheets by first estimating the likely number of rows (columns are
fixed) but as my database grows I am mindful that I will need to keep
resetting this value. Can I use the COUNTA function to count rows so
that my set print area is more dynamic ?
Finally, was wondering if there is a way in VBA to search for a cell
value and make that cell really stand out (perhaps flash) ? Am using
conditional formatting (three conditions) for row colours but need
another condition to highlight specific cell entries.
Many thanks
D:-)
--
Digory
------------------------------------------------------------------------
Digory's Profile:
http://www.excelforum.com/member.php...o&userid=16439
View this thread: http://www.excelforum.com/showthread...hreadid=278036