Mega Code Archive

 
Categories / VisualBasic Script / Forms
 

Read input from TextBox and assign the value to ActiveCell

Private Sub OKButton_Click()     If CStr(SpinButton1.Value) = TextBox1.Text Then         ActiveCell = SpinButton1.Value         Unload Me     Else         MsgBox "Invalid entry.", vbCritical         TextBox1.SetFocus         TextBox1.SelStart = 0         TextBox1.SelLength = Len(TextBox1.Text)     End If End Sub