Hello,
I would like some help in creating a button macro for a spreadsheet that is essentially a user form. The form has four cells in which the user enters requested information in cells B6, B8, B10, or B12. Not all of the cells require a number. When the user clicks on the button, I would like the number or combination of numbers to appear in B27 according to the conditions listed below. Also, if the number in B27 has more than 30 characters, I would like a message box to appear informing the user that the number needs to be (manually) changed in B27.
I know this is a bit complicated, and I hope I’ve explained it well. I appreciate any help anyone can give. Thank you.
I would like some help in creating a button macro for a spreadsheet that is essentially a user form. The form has four cells in which the user enters requested information in cells B6, B8, B10, or B12. Not all of the cells require a number. When the user clicks on the button, I would like the number or combination of numbers to appear in B27 according to the conditions listed below. Also, if the number in B27 has more than 30 characters, I would like a message box to appear informing the user that the number needs to be (manually) changed in B27.
- If a number is in cells B6, B8, or B12 only, that number alone should appear in cell B27.
- If numbers are in B8 and B10, both numbers should appear in B27 separated by a forward slash (i.e., B8/B10).
- If numbers are in B6 and B10 and B8 is blank, the number in B27 should appear as B6 and B10 separated by a forward slash (i.e., B6/B10).
- If a number is in B10, it is expected that a number should also be entered in either B6 or B8. Therefore, if a number is in B10 but not in B6 or B8, the button message will say, "You have entered only an Order number. Please enter either an appropriate Schedule No., GWAC No., IDIQ No., or BPA No, or make any other necessary corrections."
- If a number is entered in all cells (B6, B8, B10, or B12), then button message will say, "You have entered too many numbers. Please delete the extraneous numbers."
- If the number that shows up in B27 exceeds 30 characters, button message will say, "The contract number exceeds 30 characters. Please shorten the number by entering it directly in B27."
I know this is a bit complicated, and I hope I’ve explained it well. I appreciate any help anyone can give. Thank you.