zac_fozz
New Member
- Joined
- Jan 5, 2010
- Messages
- 6
I am relatively new to macros. I'm using Excel 97. I've made a spreadsheet for our office staff to use to enter their hours worked (and vacation taken, etc.) for the week.
At the top of the sheet, the user chooses their name from a drop down menu (in cell B3), created by a Data Validation List. Then they enter their hours. At the bottom of the sheet there is a cell (E20) for them to enter their initials. I've worked up a rather complicated IF statement to conditionally format the "initials cell" yellow when the name at the top corresponds to the appropriate initials.
I've also created a button (using the forms toolbar, not the control toolbar) that the user will click to save the spreadsheet to a folder on our network. What I am trying to do is make that button invisible until an IF statement is true.
Here's the code for the IF statement (it's actually two IF statements but I'd like it to be one, I hit the maximum 7 nested IF's limit):
=IF(B3="Lolly Lou",OR(E20="LL",E20="LAL"),IF(B3="Sunny Day",OR(E20="SD",E20="SDM"),IF(B3="Sad Dog",OR(E20="SD",E20="SAD"),IF(B3="Ziggy Farce",OR(E20="ZDF",E20="ZF")))))
=IF(B3="Wally Hideaway",OR(E20="WLH",E20="WH",E20="BLH",E20="BH"),IF(B3="Jilly Willy",OR(E20="JW"),IF(B3="Lucas Yucas",OR(E20="LBY",E20="LY"))))
And here's the code to hide the button (I got this from another thread):
Sorry this post is so long. Can anyone help?
Thanks!
At the top of the sheet, the user chooses their name from a drop down menu (in cell B3), created by a Data Validation List. Then they enter their hours. At the bottom of the sheet there is a cell (E20) for them to enter their initials. I've worked up a rather complicated IF statement to conditionally format the "initials cell" yellow when the name at the top corresponds to the appropriate initials.
I've also created a button (using the forms toolbar, not the control toolbar) that the user will click to save the spreadsheet to a folder on our network. What I am trying to do is make that button invisible until an IF statement is true.
Here's the code for the IF statement (it's actually two IF statements but I'd like it to be one, I hit the maximum 7 nested IF's limit):
=IF(B3="Lolly Lou",OR(E20="LL",E20="LAL"),IF(B3="Sunny Day",OR(E20="SD",E20="SDM"),IF(B3="Sad Dog",OR(E20="SD",E20="SAD"),IF(B3="Ziggy Farce",OR(E20="ZDF",E20="ZF")))))
=IF(B3="Wally Hideaway",OR(E20="WLH",E20="WH",E20="BLH",E20="BH"),IF(B3="Jilly Willy",OR(E20="JW"),IF(B3="Lucas Yucas",OR(E20="LBY",E20="LY"))))
And here's the code to hide the button (I got this from another thread):
Code:
Sub Button23_Click()
Dim cmd As Object
Set cmd = Worksheets("Timesheet").Shapes("Button 23")
cmd.OLEFormat.Object.Visible = Not cmd.OLEFormat.Object.Visible
End Sub
Sorry this post is so long. Can anyone help?
Thanks!