Hi guys,
i need help with the textbox "txtOrder" in userform.
After everything what is listed bellow done i need to highlight the numbers in the textbox "txtOrder", so the user dont have to use the backspace key to clear the numbers in textbox "txtOrder" and can start typing the numbers straight away.
Thanks for your help
Private Sub cmdUpdate_Click()
If Trim(Me.txtQty.Value) = "" Then Exit Sub
Dim Addto As Range, ctl As Control, ws As Worksheet: Set ws = Sheet2
If Me.Frame3.Visible = True And Me.Frame3.Enabled = True Then
For Each ctl In Me.Frame3.Controls
If ctl Then
With ws
Set Addto = ws.Range("a" & Rows.Count).End(xlUp).Offset(1)
Addto.Resize(, 17) = Array(cmbDate.Value, txtTime.Value, cmbOperator, cmbLine.Value, txtOrder.Value, txtPart.Value, txtDescription, txtQty.Value, txtUom, txtSample.Value, cmbMaj.Value, cmbPass, cmbFailr, txtComments, cmbOnline, cmbCode, cmbCoperator)
Addto.Offset(, 17) = ctl.Caption
End With
End If
Next
Else
Set Addto = ws.Range("a" & Rows.Count).End(xlUp).Offset(1)
Addto.Resize(, 17) = Array(cmbDate.Value, txtTime.Value, cmbOperator, cmbLine, txtOrder.Value, txtPart.Value, txtDescription, txtQty.Value, txtUom, txtSample.Value, cmbMaj.Value, cmbPass, cmbFailr, txtComments, cmbOnline, cmbCode, cmbCoperator)
Addto.Offset(, 17) = Array(cmbStation)
End If
txtTime.Value = Format(Time, "Long Time")
txtPart.Value = ""
txtDescription.Value = ""
txtQty.Value = ""
txtUom.Value = ""
cmbCoperator.Value = ""
cmbMaj.Value = ""
cmbCode.Value = ""
txtCdescription.Value = ""
cmbFailr.Value = ""
txtComments.Value = ""
txtSample.Value = ""
cmbStation.Value = ""
End Sub
Bookmarks