I'm trying to select a textbox from my form in excel with the command #set focus "but apparently it gives me an error, can someone help me?
Error:
Note: I replaced "Call Me.in_A0r.SetFocus" for " in_A0r.SetFocus" because it didn't work too
Form:
Error:
VBA Code:
Private Sub cmd_Recheck1_Click()
A0r = in_A0r.Value
A90r = in_A90r.Value
A_90r = in_A_90r.Value
A1 = 0
A2 = A90r - A0r
A3 = A_90r - A0r
Delta = IIf(Abs(A1) > Abs(A2), A1, A2)
Delta = IIf(Abs(A3) > Abs(Delta), A3, Delta)
ActiveWorkbook.Sheets("calculation_sheet").Activate
Range("I6").Select
P666i = ActiveCell.Value
Range("I7").Select
P709i = ActiveCell.Value
Range("I8").Select
P710i = ActiveCell.Value
Range("I9").Select
P713i = ActiveCell.Value
Range("J6").Select
P666r = ActiveCell.Value
Range("J7").Select
P709r = ActiveCell.Value
Range("J8").Select
P710r = ActiveCell.Value
Range("J9").Select
P713r = ActiveCell.Value
ActiveWorkbook.Sheets("start").Activate
Range("A28").Select
ReChk = ActiveCell.Value
Do Until ActiveCell = ""
ReChk = ReChk + 1
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell = ReChk
'
ActiveCell.Offset(0, 1).Select
ActiveCell = P666i
ActiveCell.Offset(0, 1).Select
ActiveCell = P709i
ActiveCell.Offset(0, 1).Select
ActiveCell = P710i
ActiveCell.Offset(0, 1).Select
ActiveCell = P713i
ActiveCell.Offset(0, 1).Select
ActiveCell = P666r
ActiveCell.Offset(0, 1).Select
ActiveCell = P709r
ActiveCell.Offset(0, 1).Select
ActiveCell = P710r
ActiveCell.Offset(0, 1).Select
ActiveCell = P713r
ActiveCell.Offset(0, 1).Select
ActiveCell = Delta
ActiveWorkbook.Sheets("calculation_sheet").Activate
Range("I6").Select
ActiveCell = P666r
Range("I7").Select
ActiveCell = P709r
Range("I8").Select
ActiveCell = P710r
Range("I9").Select
ActiveCell = P713r
Range("B18").Select
ActiveCell = 0
Range("B26").Select
ActiveCell = 0
Range("B33").Select
ActiveCell = 0
ActiveWorkbook.Sheets("Start").Activate
Application.ScreenUpdating = True
Sheets("Calculation_Sheet").Visible = False
Range("A1").Select
in_A0r.Value = Null
in_A90r.Value = Null
in_A_90r.Value = Null
out_666r.Value = Null
out_709r.Value = Null
out_710r.Value = Null
out_713r.Value = Null
out_Spread1.Value = Null
in_A0r.SetFocus
End Sub
Note: I replaced "Call Me.in_A0r.SetFocus" for " in_A0r.SetFocus" because it didn't work too
Form: