View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Macro to Filter on active cell within autofilter

Robin,

This is written with the assumption that you have only one contiguous data table filtered:

Sub FilterBasedOnActiveCellContents()
ActiveCell.CurrentRegion.AutoFilter _
Field:=ActiveCell.Column - ActiveCell.CurrentRegion.Cells(1).Column + 1, _
Criteria1:=ActiveCell.Value
End Sub

HTH,
Bernie
MS Excel MVP


"Cheekyaardvark" wrote in message
ups.com...
I have a spreadsheet that I already have autofilter activated on, what
I would like to do is have a macro that I can pop on my toolbar that
will filter the file based on the active cell contents, I had a macro
that did this in previous verison of excel but I somehow lost it during
migration to excel 2003 & cannot recreate it


Can anybody guide me on this

Appreciate it

Robin