Disable Drop Menu When Criteria Is Met?

Margate

New Member
Joined
Mar 15, 2013
Messages
21
Hello Everyone,
I have a validation drop menu (data / validation / settings / list) that I want to disable when one date is greater than another date. So for example today is 5th November but I want the drop menu to disable when the date is 6th November. Cell C1 contains a start date (can be any date at all) and cell D1 contains today's date
Code:
=TODAY()
.

The source for the contents of the drop menu is A1:A5 and the actual drop menu is in cell B1. The drop menu contains just numbers from 1-5 (including both 1 & 5). Whenever one of these numbers is selected from the drop menu a macro is called using the following code:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("C6")) Is Nothing Then
  Select Case Target.Value
    Case 1
      Call DayOne
    Case 2
      Call DayTwo
    Case 3
      Call DayThree
    Case 4
      Call DayFour
    Case 5
      Call DayFive
  End Select
End If

Each number (1-5) calls a macro that just hides / un-hides the numbers of rows that are visible on the sheet.
Is there any way to perhaps add a couple of lines into the above code or an easier way to disable this as soon as the day expires? All I want to do is to prevent the drop meun from being usable any what possible. I tried using if statements but to no avail!

Thank you very much for any help

Margate:biggrin:
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,215,503
Messages
6,125,175
Members
449,212
Latest member
kenmaldonado

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