VBA 'Enter date as' message box

Djentle

New Member
Joined
May 30, 2011
Messages
2
Hey everyone,

I'm new to the forum here, so hopefully I'm not creating a duplicate thread. I did take a search, but I couldn't find what I was looking for.

I want to create a message box that is triggered if an incorrect date format is entered into a cell. The format needs to be mmm/yy. Basically, if the user goes to the cell and enters the date correctly, nothing will happen, but if the user enters something outside of mmm/yy, a message box will appear saying 'please enter date as mmm/yy' and the string will appear in the cell after they enter and click ok.

If anyone has any advice or can give me a hand that would be greaty appreciated!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hey, thanks for the quick reply.

I wasn't aware of that feature and thanks for pointing it out. I think it should do the trick. I didn't use the settings section, just the Input Message area. Now I guess doing this won't force the user to use the mmm-yy format, but it will ask them to use it which might be good enough.

The only real difference between that and what I was looking for would be a message box that only put the input into the cell if it was in mmm-yy, otherwise it would just keep asking the user. It's too bad excel didn't have an input mask feature.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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