LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default code for conditional validation to textboxes

Mr.Rick,
My 3rd question with same conditions(If Textbox2 value should be greater than
TextBox10)
Can I modify the code line to test the both test boxes,for " if textbox2
value should be greater than
textbox1, with all the above conditions remains same.
If Len(.Text)0 And .value TextBox1.value Then
will this modification works or not/

Rick Rothstein (MVP - VB) wrote:
I am probably missing something in your question, but why can't you simply
test if the Text values of the two TextBoxes are equal or not (doesn't
matter if the entry is numeric or not... if there's something in TextBox1,
then it has to equal TextBox2... period)...

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
With TextBox2
If Len(.Text) 0 And .Text < TextBox1.Text Then
MsgBox "Invalid entry! Entry must match archival value."
Cancel = True
.SelStart = 0
.SelLength = Len(.Text)
End If
End With
End Sub

Rick

Mr.Rick,
I have a some modification of my question,can you modify the code a bit

[quoted text clipped - 54 lines]
or
corrects the entry by putting only numeric values.


--
Message posted via http://www.officekb.com

 
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
Validation subroutine for textboxes chemicals Excel Programming 4 February 28th 08 07:57 PM
Show Results in TextBoxes, ONLY if All TextBoxes have Data in them RyanH Excel Programming 3 November 19th 07 03:30 PM
format validation in UserForm textboxes Soultek Excel Programming 1 February 1st 07 07:37 PM
Addition code for 110 TextBoxes John Wilson Excel Programming 4 January 27th 04 03:41 AM
Addition code for 110 TextBoxes Todd Huttenstine[_3_] Excel Programming 1 January 27th 04 03:11 AM


All times are GMT +1. The time now is 02:27 PM.

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

About Us

"It's about Microsoft Excel"