VBA - Unhide Rows if CommandButton No Longer Exists?

dhevans333

New Member
Joined
Sep 27, 2016
Messages
7
Putting together a time-off request template with a "Submit" button (assigned macro that will confirm required data input, validate entries, calculate hours subtracting holidays/weekends, etc., email to supervisor, etc.) that is deleted after submission. I have hidden rows with supervisors review/approval/denial that I want to appear if the button doesn't exist.

Previously rows were hidden until employee entered date of submission, and when supervisor received and opened document, rows would become unhidden using Workbook_Open If statement (cell not empty) - but would rather have it automatically enter the date the Submit button is hit (already set up), and unhide rows if commandbutton no longer there.

Currently:

Private Sub Workbook_Open()

ActiveSheet.Unprotect ("PASSWORD")
If Range("C58") = "" Then
Rows("60:64").EntireRow.Hidden = True
Else: Rows("60:64").EntireRow.Hidden = False
End If

ActiveSheet.Protect ("PASSWORD")

End Sub

Any options?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,223,155
Messages
6,170,403
Members
452,325
Latest member
BlahQz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top