I have a Userform with 7 TextBoxes, TextBox1, TextBox2a, TextBox2b, TextBox3a, TextBox3b, TextBox4a, and TextBox4b.
As the Userform opens I would like it to check if all 7 TextBoxes have a value. The corresponding cells are in a worksheet named “Income 1 Data” and are as follows:
If any (one or more) of the cells have not been assigned a value I would like a prompt to appear stating “Not all default values have not been declared. Do you want to set default values?”TextBox1 = Cell A2 and has a Text value
TextBox2a = Cell C2 and has a Number value
TextBox2b = Cell G2 and has a Percentage value
TextBox3a = Cell D2 and has a Number value
TextBox3b = Cell H2 and has a Percentage value
TextBox4a = Cell E2 and has a Number value
TextBox4b = Cell I2 and has a Percentage value
If yes, Userform to input values, if no, then cancel default values and accept user input from main Userform. I think it would be too complicated to state which defaults have not been declared unless it is possible to sate it within the MessageBox. For example if Cell A2 and C2 have not been assigned a value: “Taxable Marital Status, Federal Exemption default values have not been declared. Do you want to set default values?”
If the user chooses to ignore the Message by canceling it, then have the tab stop set to TextBox1 then the next, Etc. If all the required cells have values then tab to the next TextBox in the Userform (TextBox5).
If a user wishes to change the default value by way of the Userform through a Doubleclik event in the corresponding TextBox let it be so, but upon closure of the Userform have a MessageBox appear stating “Some default values have been changed. Do you want to save changes (Yes, No). Again I think it would be too complicated to declare which values have been changed.
I can’t seem to get my head around the required looping and conditioning. I can really use some help with this.
Thanks
Bookmarks