Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hiya,
This is my code; Private Sub OKButton_Click() ' Make sure a name is entered If TextName.Text = "" Then MsgBox "You must enter a valid numeric value." TextName.SetFocus Exit Sub End If If TextName.Text ActiveCell.Offset(-1, 0) Then MsgBox "Value cannot be greater than hours in the day!" TextName.Text = "" TextName.SetFocus Exit Sub End If ' Transfer the name ActiveCell = TextName.Text ' ' Clear the controls for the next entry TextName.Text = "" TextName.SetFocus End Sub My problem is the second test that checks the value entered, if it is greater than the offset cell then msg box appears and the value is rejected, If offest cell value is say 7.5, and I enter 8.0 then value is rejected as it should, but if I enter 10 then the value is accepted, but it should be rejected is value is still greater than offset cell, But I can't figure out why. Where am I going wrong? Any help is very much appricated. Regards Laddie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform textbox help | Excel Programming | |||
TEXTBOX in USERFORM | Excel Programming | |||
userform textbox | Excel Worksheet Functions | |||
Textbox in userform | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |