Tickboxes and the macro's behind them
Here's the code behind the tickbox :-
Sub Health_Month_End_Click()
Application.ScreenUpdating = False
Call Sort_Extra_Batch("Healthcare")
End Sub
The "Sort_Extra_Batch" is a routine that I have written. Here's the code
for that :-
Sub Sort_Extra_Batch(System_Name As String)
Sheets("Front End").Select
Select Case System_Name
Case "Life"
Sort_Range = "C15:D29"
Sort_Key = "C15"
Highlight_Cell = "B7"
Case "Bank"
Sort_Range = "G15:H29"
Sort_Key = "G15"
Highlight_Cell = "F7"
Case "Investment"
Sort_Range = "K15:L29"
Sort_Key = "K15"
Highlight_Cell = "J7"
Case "Healthcare"
Sort_Range = "O15:P29"
Sort_Key = "O15"
Highlight_Cell = "N7"
End Select
Range(Sort_Range).Select
Selection.Sort Key1:=Range(Sort_Key), Order1:=xlDescending, Header:=xlNo _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Highlight_Status (Highlight_Cell)
Home_Cell
End Sub
As I said it displays the userform before it executes any of the above code...
--
Cheers...
"Duncan" wrote:
can you post the code behind the tickbox?
|