Hello Everyone
I need help with some VBA to show a message in a text box when a number is entered into a cell. There are 6 different pieces of text depending on which number is entered.
Any help would be great!
Hello Everyone
I need help with some VBA to show a message in a text box when a number is entered into a cell. There are 6 different pieces of text depending on which number is entered.
Any help would be great!
Hello jiminic,
Is this TextBox on a UserForm or Worksheet? What are the six values to display, and what are the numbers?
Sincerely,
Leith Ross
Hi Leith
Thanks for your response. this is in a worksheet and the numbers are ranging as follows:
<21,
>21 but <30,
>31 but <40,
>41 but <50,
>51 but <60, and
>60
Thank you again
Hello jiminic,
You could use the Select Case statement for this.
Sincerely,![]()
Select Case ActiveCell.Value Case <21 Msg = "Less than 21" Case 22 To 30 Msg = "Between 22 and 29" Case 32 To 39 Msg = "Between 32 and 39" Case 42 To 49 Msg = "Bewteen 42 and 49" Case 52 and 59 Msg = "Between 52 and 59" Case >60 Msg = "Greater than 60" End Select MsgBox Msg
Leith Ross
Thank you Leith
One last question though, where do I put the code, and how do I make it so that when the number is entered into a specific cell, eg: E38, that the message box appears?
Hello jiminc,
Do you have a range of cells this will apply to?
Thanks,
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks