LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default textbox validation

I'm trying to validate user input in a userform textbox, based on a
value in a worksheet cell.
The following sub works fine:

Private Sub TextBoxDay_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBoxDay.Value 0 AND < 32 Then Exit Sub
MsgBox "Valid Days Only"
TextBoxDay = vbNullString
Cancel = True 'Keeps focus until value is null or correct
End Sub


However I cannot get the following code to work:

Private Sub TextBoxDay_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBoxDay.Value 0 AND TextBoxDay.Value < _
Worksheets("Begin").Cells(15, 9) Then Exit Sub
MsgBox "Valid Days Only"
TextBoxDay = vbNullString
Cancel = True 'Keeps focus until value is null or correct
End Sub


I've tried a number of variations but I can't seem to find a cell
reference that works. Worksheets("Begin").Cells(15, 9) = 32.

Thanks for any suggestions

Tim
 
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
Textbox validation TUNGANA KURMA RAJU Excel Discussion (Misc queries) 5 May 8th 09 11:15 PM
validation of input in textbox Peer Excel Programming 3 July 23rd 04 03:06 PM
textbox value validation girapas[_2_] Excel Programming 1 July 19th 04 12:16 PM
Textbox validation phreud[_17_] Excel Programming 6 June 27th 04 07:49 PM
textbox validation Beginner[_2_] Excel Programming 1 April 7th 04 07:46 PM


All times are GMT +1. The time now is 10:40 AM.

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"