Consulting

Results 1 to 3 of 3

Thread: Solved: Changing Values Between Text Boxes

  1. #1
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    188
    Location

    Solved: Changing Values Between Text Boxes

    Hi Good Morning

    Is it possible if a value of between 1 - 3 is entered in Tb1 - Tb2 will display a value of 10.00 if however any value between 4 -50 is entered in Tb1 - Tb2 will display a value of 0.00

    [vba]
    Private Sub Add_Click()
    Application.ScreenUpdating = False
    Dim iRow As Long
    Dim ws As Worksheet
    Dim LngPos As Long
    Set ws = Worksheets("Sheet1")
    iRow = ws.Cells(Rows.Count, 1) _
    .End(xlUp).Offset(1, 0).Row
    ws.Cells(iRow, 3).Value = UserForm1.Tb1.Text
    ws.Cells(iRow, 4).Value = UserForm1.Tb2.Text
    Application.ScreenUpdating = True
    End Sub
    [/vba]

    Many Thanks

    Sooty8

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub Add_Click()
    Application.ScreenUpdating = False
    Dim iRow As Long
    Dim ws As Worksheet
    Dim LngPos As Long
    Set ws = Worksheets("Sheet1")
    iRow = ws.Cells(Rows.Count, 1) _
    .End(xlUp).Offset(1, 0).Row
    Select Case UserForm1.Tb2.Text - UserForm1.Tb1.Text

    Case Is < 1: 'do what

    Case Is <= 3: MsgBox "10.00"

    Case Is <= 50: MsgBox "0.00"
    End Select
    Application.ScreenUpdating = True
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    188
    Location
    Hi Xld

    Many Thanks For Your Help -- Marked as Solved

    Regards

    Sooty8

Posting Permissions

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