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!
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,050
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.
 

adxox

New Member
Joined
Oct 25, 2017
Messages
4
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.
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,050
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?
 

adxox

New Member
Joined
Oct 25, 2017
Messages
4
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.
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,050
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,774
Messages
5,470,707
Members
406,718
Latest member
waseem11

This Week's Hot Topics

Top