#1   Report Post  
Greg B
 
Posts: n/a
Default Text box formatting

I have a userform where the person puts in totals

How do I get excel to not allow a total more than 180 in a textbox.

Also is there a chance of excel giving a warning about this total

Thanks in advance

Greg



  #2   Report Post  
Rob Bovey
 
Posts: n/a
Default

"Greg B" wrote in message
...
I have a userform where the person puts in totals
How do I get excel to not allow a total more than 180 in a textbox.
Also is there a chance of excel giving a warning about this total


Hi Greg,

Here's one very simplified way to accomplish this:

Private Sub TextBox1_Change()
If Val(TextBox1.Text) 180 Then
MsgBox "180 is the maximum allowed."
TextBox1.Text = ""
End If
End Sub

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to select multiple text boxes in excel for formatting Rob New Users to Excel 3 April 2nd 23 08:38 PM
Conditional formatting of text LeAnne New Users to Excel 7 March 4th 05 02:34 PM
Formatting text box Doug Loewen Excel Discussion (Misc queries) 4 February 16th 05 02:17 AM
How can I force certain text formatting in a cell? eddied Excel Discussion (Misc queries) 2 February 7th 05 12:55 PM
Concatenation formula loses text wrap formatting DFM Excel Discussion (Misc queries) 5 December 27th 04 01:45 PM


All times are GMT +1. The time now is 10:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"