View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ajliaks[_18_] ajliaks[_18_] is offline
external usenet poster
 
Posts: 1
Default VBA - not working

Hi

I am trying the way you told me, but is not working right. I guess I a
missing something.

when I run it, I allways get the MsgBox "Value must be between 0.0
1.0", no mather the value.

Private Sub PercentTB_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim Min As Variant
Dim Max As Variant

PercentTB.Value = Format(CSng(PercentTB.Value), "##.#%")

Min = Format(CSng(0), "##.#%")
Max = Format(CSng(1), "##.#%")

If (PercentTB.Value < Min) Or (PercentTB.Value Max) Then
MsgBox "Value must be between 0.0 - 1.0", vbOKOnly
Cancel = True
End If
End Su

--
Message posted from http://www.ExcelForum.com