Date to stop macro

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,057
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Hi I have an bill data macro in excel 2007, I just want a code, if any person click on the Run button, the macro should not run

eg:- if in the system date is 10 Feb 2013 and any person clicks on the run button the macro should not run.

Thanks.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi,

What is the criteria? What relevance is 10 Feb 2013?

Where is this date stored? Does this mean that you have reports whereby the date is blank or a future date? So, in effect, you are comparing a date in a cell against the current date?

Is this correct? You will need to provide further details in order to get a resolution.

Thanks
 
Upvote 0
P.s. If you did just want to compare a cell to todays date you could use something simple like this

If Range("A1").Value<Date Then
Exit Sub
Else
*** Enter Macro code here***
End if
End Sub
 
Upvote 0
we need to pick the date form the system. as my macro do not have any date column or so

I have fig it as

this

on the workbook open

If Now() >= "20/01/2014 00:00:00" Then
Worksheets("Ubsoft").OLEObjects("CommandButton1").Enabled = False
End If
Worksheets("Ubsoft").OLEObjects("CommandButton1").Enabled = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,569
Members
449,038
Latest member
Guest1337

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