PDA

View Full Version : Solved: Changing Values Between Text Boxes



sooty8
10-09-2009, 02:04 AM
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


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


Many Thanks

Sooty8

Bob Phillips
10-09-2009, 04:40 AM
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

sooty8
10-09-2009, 08:37 AM
Hi Xld

Many Thanks For Your Help -- Marked as Solved

Regards

Sooty8