Afternoon all,
Just require a wee bit of help with the following code. It sits in the "This Workbook" code window to run each time the wbook is opened. What I want it to do, is based on the date in Sheets("Control").Range("L3") select a particular cell in another sheet called "Risk Sum". I'm assuming this is easy to do, I've come up with the following, but it just doesnt want to work...!!
Private Sub Workbook_Open()
Dim mth
Dim control_date
control_date = Worksheets("Control").Range("L3")
Sheets("Risk Sum").Select
Select Case mth
Case control_date = "*/01/*": Range("risksum_jan").Activate
Case control_date = "*/02/*": Range("risksum_feb").Activate
Case control_date = "*/03/*": Range("risksum_mar").Activate
Case control_date = "*/04/*": Range("risksum_apr").Activate
Case control_date = "*/05/*": Range("risksum_may").Activate
Case control_date = "*/06/*": Range("risksum_jun").Activate
Case control_date = "*/07/*": Range("risksum_jul").Activate
Case control_date = "*/08/*": Range("risksum_aug").Activate
Case control_date = "*/09/*": Range("risksum_sep").Activate
Case control_date = "*/10/*": Range("risksum_oct").Activate
Case control_date = "*/11/*": Range("risksum_nov").Activate
Case control_date = "*/12/*": Range("risksum_dec").Activate
End Select
End Sub
Can someone suggest something a little tidier / more importantly something that works!!
Cheers
Colin
Just require a wee bit of help with the following code. It sits in the "This Workbook" code window to run each time the wbook is opened. What I want it to do, is based on the date in Sheets("Control").Range("L3") select a particular cell in another sheet called "Risk Sum". I'm assuming this is easy to do, I've come up with the following, but it just doesnt want to work...!!

Private Sub Workbook_Open()
Dim mth
Dim control_date
control_date = Worksheets("Control").Range("L3")
Sheets("Risk Sum").Select
Select Case mth
Case control_date = "*/01/*": Range("risksum_jan").Activate
Case control_date = "*/02/*": Range("risksum_feb").Activate
Case control_date = "*/03/*": Range("risksum_mar").Activate
Case control_date = "*/04/*": Range("risksum_apr").Activate
Case control_date = "*/05/*": Range("risksum_may").Activate
Case control_date = "*/06/*": Range("risksum_jun").Activate
Case control_date = "*/07/*": Range("risksum_jul").Activate
Case control_date = "*/08/*": Range("risksum_aug").Activate
Case control_date = "*/09/*": Range("risksum_sep").Activate
Case control_date = "*/10/*": Range("risksum_oct").Activate
Case control_date = "*/11/*": Range("risksum_nov").Activate
Case control_date = "*/12/*": Range("risksum_dec").Activate
End Select
End Sub
Can someone suggest something a little tidier / more importantly something that works!!
Cheers
Colin