Thread: Autofiltering
View Single Post
  #3   Report Post  
tina
 
Posts: n/a
Default

Hi
A basic macro you could use is
sub macrofilter()
myname = activecell
Sheets("Sheet2").Select
Range("A1").Select
Selection.AutoFilter Field:=1, Criteria1:=MYNAME
end sub

this would need to be run when the activecell is the name you want filtered
the macro could be assigned to a button to do this select button from forms
toolbar and assign macrofilter change button text to something like "filter
now"
you may want to add something like this to the begiining of macro to make
sure when select button the cursur is in correct column
If ActiveCell.Column < 1 Then
MsgBox "you must be in columnn A"
Exit Sub
Else
End If
another way would be to use worksheet function like

Private Sub Worksheet_SelectionChange(ByVal TARGET As Range)
If Not Application.Intersect(Range("a1:a100"), TARGET) Is Nothing Then
Macrofilter
Else
End If
End Sub
this would run everytime you select a cell in range("a1:a100")
this needs to be written on sheet1 in of microsoft excel objects in vb editor
hope this gives you a start
Tina
" wrote:

Hello,

I wonder if anyone can help me please ?

Firstly, apologies if what I am asking for is not possible, or if it
has been asked before, but I've had a look, and can't seem to find it.

I have a spreadsheet which I distribute weekly to certain people.
It is basically a top level view of incidents, which shows the
following.

Sheet Number 1 is :
Person - Count
Joe Bloggs - 42
Fred Bloggs - 12

And so on.

This shows me a summary of how many incidents per person have been
logged.

Sheet Number 2 is the actual raw data for that count, so it shows every
line.
So in the above example, there would be 42 lines for Joe and 12 for
Fred.

What I'd like is to put a hyperlink on sheet 1, whereby if you click
onto Fred's name, it will take you to sheet 2 and autofilter to only
show Fred's records (i.e 12 of them)

Firstly is this possible ?
Secondly can anyone point me in the right direction of where to start ?

Thanks in advance.

J.