I need some help. I need to build a macro to look at a numeric form field and only allow entries of null, 1 thru 8 and increments of 0.25. So values could be .25 to 8. I'm running Word 97. Thanks
I need some help. I need to build a macro to look at a numeric form field and only allow entries of null, 1 thru 8 and increments of 0.25. So values could be .25 to 8. I'm running Word 97. Thanks

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
A bit sloppy, but worthy of consideration?
<pre>Sub TestNumericRange()
Dim lnum As Double
Dim lnum2 As Double
lnum = InputBox("Enter a number: ")
lnum2 = lnum / 0.25
Select Case lnum
Case 0.25 To 8
If lnum2 Mod 2 = 0 Then
MsgBox "Number is ok."
Else
MsgBox "Bad number"
End If
Case Else
MsgBox "Bad number"
End Select
End Sub
</pre>
Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
<img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>
Thanks Kevin!
Just curious: did it work for you?
Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
<img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>