OscarAlberto
Programmer
I wrote this code to enter information on cells and to provide the user with inmediate feedback regarding his-her input: negative numbers, non numeric input, empty textbox when input required, etc. I found that the input is made, but after I hit the OK button, the data dissapears from the worksheet. Please provide help. Thank you in advance.
Private Sub TextBox60_Change()
Call ObjectVarDeclar (declares object variables)
Dim Msg As Variant
If ((TextBox60.Value > 100) Or (TextBox60.Value < 0) Or (IsEmpty(TextBox60.Value))) Then
Msg = MsgBox(vbCrLf & vbCrLf & vbTab & _"INVESTMENT PLAN - SECTION #2" & vbCrLf & vbCrLf & _
"You must ENTER a NUMERIC VALUE, GREATER than zero, and LESS or EQUAL to 100", vbOKOnly, _
Else: Assumptions.Range("InvestmentPlanSecc1"
.Offset(59, 1) = TextBox60.Value / 100
Assumptions.Range("InvestmentPlanSecc1"
.Offset(59, 1).NumberFormat = "#0.00%"
End If
End Sub
Private Sub TextBox60_Change()
Call ObjectVarDeclar (declares object variables)
Dim Msg As Variant
If ((TextBox60.Value > 100) Or (TextBox60.Value < 0) Or (IsEmpty(TextBox60.Value))) Then
Msg = MsgBox(vbCrLf & vbCrLf & vbTab & _"INVESTMENT PLAN - SECTION #2" & vbCrLf & vbCrLf & _
"You must ENTER a NUMERIC VALUE, GREATER than zero, and LESS or EQUAL to 100", vbOKOnly, _
Else: Assumptions.Range("InvestmentPlanSecc1"
Assumptions.Range("InvestmentPlanSecc1"
End If
End Sub