• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Message box to come up when a cell is left blank

Martin Lloyd

New Member
I would like the VBA code for the following:

Cell A1 has a popup calendar
Cell A2 is for filling in number

If cell A1 is left blank (without the popup date inserted) and cell A2 has a value entered, then I would like a popup message saying 'Must fill in the date"

I have a range of cells that require this function (eg A1 & A2, D1 & D2, E1 & E2 etc.)

Help on this would be very much appreciated as always!
 
Have you thought about using Data Validation to achieve this end?
Provide a simple example file and I think you'll find you get a range of results to choose from ...
 
@Martin Lloyd
You asked something like this,
but You didn't mean it ...
Test: select Dates from 'popup' and numbers have to write (can be from 1 to 10)
 

Attachments

  • a_cell_is_left_blank.xlsb
    37.3 KB · Views: 10
Last edited:
Answer from Vletm - means nothing to me, I didn't understand your answer.
Answer from David Evans - No, I haven't tried data validation as I can't see how it can work.
I would much prefer a message window via VBE to work this issue. If you can help with this, I would appreciate it.

__________________________________________________________________
Mod edit : thread moved to appropriate forum !
 
@Martin Lloyd
You wanted:
I would like the VBA code for the following:
Cell A1 has a popup calendar & Cell A2 is for filling in number
If cell A1 is left blank (without the popup date inserted) and cell A2 has a value entered, then I would like a popup message saying 'Must fill in the date"
I have a range of cells that require this function (eg A1 & A2, D1 & D2, E1 & E2 etc.)

Am I right?
Click that file I upload for You. Open it.
Move Your mouse on 2nd row => activate any cell => enter number (1..10)
=> press <ENTER> ... You should get a popup message!
There are also a basic calendar dropdown in row 1.
>>> Questions?
 
@Martin Lloyd - "Answer from David Evans - No, I haven't tried data validation as I can't see how it can work." Interesting logic - with that mindset we'd never learn anything new, but here's an example of how it can work for you ...

If you enter a number into the B5 with A5 being empty, a message box will display - you can customize the message to your specifications - This one is a Lloyd Data Warning

You can also have a label appear each time your user selects the particular cell - as in Mr Lloyd's Test Message shown ...

upload_2015-12-20_20-39-14.png


Absolutely it can be done in VBA, but it will be tedious to implement if you have very basic Excel users - they will need to have macros enabled and they're security settings will probably need tweakingupload_2015-12-20_20-39-14.png
 

Attachments

  • Lloyd Test.xlsx
    9.4 KB · Views: 0
Back
Top