Just a quickie

  • Thread starter Thread starter Chris Smith
  • Start date Start date
C

Chris Smith

Hello all...

I need some help with this... I have tried every where, and have no
joy....

I have a spreadsheet taht has 5 worksheets. They are Results, Div 1,
Div 2, Div 3, Div 4.

I have got it so that when I enter the results for each division the
IF formlas enter the resutls onto the correct divisions page..... No
problems there...

The problem is, Instead of doing a manual sort, I want to be able to
click a cell on the Results page and that cell to sort the
corresponding division worksheet. So that would be 4 cell's/buttons
with the right macro's(?) attached to do that.

I know it can be do, as an old workplace of mine has that for their
Weekly figures for each area. You clicked a cell/button on the main
sheet, enered Week End and it sorted them out for you.

All help apprieciated in advance.
 
Type a list Div3,Div4,etc on your Results page. Right click sheet tab>view
code>copy paste this>modify to suit your ranges. Now when you double click
on the desired sheet name, it will be sorted. NO buttons needed.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
x = ActiveCell.Value 'Div3, Div4, etc.
Sheets(x).Range("A3:C5").Sort Key1:= _
Sheets(x).Range("A4"), Order1:=xlAscending, _
Header:=xlGuess, _
Orientation:=xlTopToBottom
End Sub
 
Back
Top