Excel 2013 vba

adxox

New Member
Joined
Oct 25, 2017
Messages
4
Hiya,

So im pretty new too excel and im trying to create a document that if mandatory fields are not filled out then you cannot close the document and a POP UP will appear saying *Please fill out this mandatory field* .

However I want it for a range off cell but not necessary in the same column. One may be B2 and another might be F16.

I also would like to do a different POP up msg for different not filled out fields. So one may be *Please Fill out Clients Surname* where as another may be *Please Fill out Clients Name*.


Last thing I need to know how to have a minimum word count within a cell so "You must have to type 300 words before moving closing document*.

Has anyone got any templates, videos, or step to step guides to do this.

Thank you in advance!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
We would need to know what the mandatory fields (cells) are with their corresponding pop up messages. Also, do you want to limit the word count to 300 in the same cells.
 
Upvote 0
Hiya,

So ive sorted the mandatory field not using a VBA but just using data validation.

However I need all these cells to be inserted in my code and a before message to appear and not let them close the document.

The cells are:

G11
C20:C39
D20:D39
EF20:EF39 (Merged cells)
I20
J20
K20
H27: H32
I27 : I32
J27 : J32
K27 : K32
L27: K27
H38: H43
I38:I43
J38:J43
K38:K43
L38:L43
HIJKL 49:72 (Merged Cell)
D49:D52
D54: D57
D59: D62
E49:E52
E54:E57
E59:E62
D64:67
D69:12


I know there is a lot off cells, but if you can figure out at quick or easier name i appreciate it.
 
Upvote 0
In your original post you said:
I also would like to do a different POP up msg for different not filled out fields.
If you still want different messages for different fields, I would need to know what those messages are and to which fields they are linked. Also, do you want to have a minimum word count of 300 words for all fields or just some fields. If you want this to apply to some fields, I would need to know which fields. By
HIJKL 49:72 (Merged Cell)
I assume you mean H49:L72. Is this correct? You mentioned that you don't want to allow closing of the file unless all mandatory fields are filled in. What about if someone tries to save the file without all mandatory fields filled in?
 
Upvote 0
Yes but if I did it using a Data Validation do i still need to have it within my vba?

and well I have merged quiet all off cells so would it just be H49:L72? Not really sure how that bit works out to be fair..

I need more you cant close or save document until all mandatory fields are filled out.

Thank you for all off your help.
 
Upvote 0
I'm not sure how you are using data validation. Could you please clarify in detail? Merged cells almost always cause problems for Excel macros so they should be avoided if at all possible. If you must keep the cells merged, please be specific about which range of cells are merged. I would still need to know the individual messages and their associated fields. Also, if you want to have a minimum word count of 300 words for all fields or just some fields. If you want this to apply to some fields, I would need to know which fields.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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