Creating Excel Mandatory required Fields

Copper Contributor

I am creating a spreadsheet that the staff does not want to complete in full I have several columns that have mandatory fields, in C5, D5 and C17. When I create the VBA, When I press Alt - F11 I do not get the automatic VBA it just gives me the number label for Alt keys. Secondly, I have tried several formulas given but I keep getting an error message can some please help. The goal is to have the team you the date and their initials in the field prior to printing, sharing or closing. Please help...

9 Replies
What kind of machine are you using? Windows, Mac, other?
What Excel application are you using, Excel desktop or on-line?

@Jan Karel Pieterse

 

Good Morning:

I am using Windows and MS Excel 365 desktop

Yeah its still the same person... just with the 1125

@ycanderson1125 If you right-click the menu and choose Customize Ribbon you can check the box next to "Developer". That will allow you to open the VBA editor using the left-most button on that tab:

2021-12-10_15-40-19.png

Yes butt I am having problems with the code for the requirement. I have tried an If formula but I it keeps coming up with an error.
What error(s) are you getting please?

@Jan Karel Pieterse 

 

If you have any ideas on how i can make those cells required within the worksheet I can compare what may be missing in the code. I believe its in the verbiage of what I am asking for. I am requiring the team to date and initial in the cells as a sign off. If they do not then they cannot move forward. There has to be mm/dd/yy in several cells and their initials in the final cell as to sign off. Please review example attached.

@ycanderson1125 Here is a way. I have restructured your sheet so the data is in a formatted table. Above the table there is a row with *, indicating which columns are mandatory . I have formatted those columns using the Input cell style. I have also added some conditional formatting rules which change the cell color once an entry is made.

I use cell M3 to count whether all mandatory cells in every row have been filled. The formula is dynamic, it recognizes both the # of mandatory columns and the # of project rows.

Finally I have added VBA code to the ThisWorkbook module which disallows both saving and closing of the workbook if any mandatory input cell is empty.

Thank you I will try this, the rows needed to be in columns but this works Thank you very much.