View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default VBA - not working

You really should keep top one thread. To expect everyone to keep up with
your multiple postings is totally unreasonable.

What is your total code looking like now? What are you inputting and what do
you want?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ajliaks " wrote in message
...
Hi

I am trying the way you told me, but is not working right. I guess I am
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 Sub


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