Results 1 to 4 of 4
  1. #1
    jhuden
    Guest

    Numeric Macro Help

    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

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Numeric Macro Help

    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>

  3. #3
    jhuden
    Guest

    Re: Numeric Macro Help

    Thanks Kevin!

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Numeric Macro Help

    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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •