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: 12
Default Conditional BackColor Loop

I have a userform with 5 textboxes (Sample1, Sample2, ...etc). I want
to ensure the user is aware of what he or she is entering to prevent
inaccuracies. My goal is to create a loop for the following script and
another script (or combined script) to prohibit entries if the value
entered is <= -10 and = 10 the standard value.
This is the userform module I want to loop....

Private Sub ChkEditValues()
Dim lAnswer As Long


SampleVal = Val(Sample1.Text)
StandardVal = Val(Standard.Text)

'Checks values for plus or minus 3 and hilights backcolor if one of the
conditions are met'
If SampleVal <= (StandardVal - 3) Or SampleVal = (StandardVal + 3)
Then
Sample1.BackColor = &HFFFF&
lAnswer = MsgBox("Check the Hilighted Entries. If OK press YES",
vbYesNo, "Double Check")
If lAnswer = vbNo Then
Exit Sub
Else
Sample1.BackColor = &H80000005
PutData
MsgBox "Edits have been entered"
End If
Else
Sample1.BackColor = &H80000005

End If

End Sub

 
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
multiselect listbox backcolor Russ Excel Programming 5 September 1st 05 11:39 PM
Change BackColor Steve Excel Programming 1 July 11th 05 04:09 PM
TextBox BackColor Lenny_821[_11_] Excel Programming 6 June 15th 05 06:13 PM
Changing backcolor of commandbutton scottnshelly[_21_] Excel Programming 2 April 22nd 04 11:27 PM
BackColor property code Joe Mathis Excel Programming 3 December 9th 03 04:11 PM


All times are GMT +1. The time now is 08:48 AM.

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"