I have a workbook that contains tabs such as 04-27-2014, 04-28-2014....etc. I dont want any other format than that. Can I input an error message if a user trys to enter a different format such as 4-27-2014 or 4-27-14? Thanks in advance.
I have a workbook that contains tabs such as 04-27-2014, 04-28-2014....etc. I dont want any other format than that. Can I input an error message if a user trys to enter a different format such as 4-27-2014 or 4-27-14? Thanks in advance.
Last edited by flextera; 07-03-2014 at 02:57 PM.
This works - perhaps some variant?
![]()
Please Login or Register to view this content.
If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)
You can't do one thing. XLAdept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin
Could you provide a sample sheet so that I can learn from this alittle. I dont do much with VB.
This is a workbook Event macro, it goes in the ThisWorkbook module in the VBA editor. It runs itself based on the event being watched. In this case it triggers itself anytime a new sheet is added.
1) Open the VBA Editor
2) Open the ThisWorkbook module
3) Paste in the event code given above
4) Close the VBA editor
5) Save your workbook as a .xlsm to preserve the vba
6) Try adding a new sheet
http://screencast.com/t/BhpGbBUuWXWP
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
I entered that in and saved it as a Macro enabled worksheet but it still lets me enter m-dd-yyyy?
Capture.PNG Here is what I have in the Workbook module
Nevermind it worked!! Thanks a ton you two :d :d :d :d
@ Jerry - thanks for fielding the follow up and, thanks for the rep!
@ flextera - You're welcome and, thanks for the rep!
*does that solve your problem or would you like other features?
This completely solves my problem. Everything works perfectly. Thanks for the Code!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks