D
damorrison
When a userform shows, the first textbox acts strange, it does this
if I want to enter a 15 it shows like this
殎5
or this, the first diget always shows up as the square thing
⎎2
掎4
Here's the codes
Option Explicit
Dim i As Integer
Private Sub CommandButton1_Click()
Dim varNbRows As Double
Range("C1").Select
varNbRows = Selection.CurrentRegion.Rows.Count
If Selection.Value = "" Then
Exit Sub
ElseIf Selection.Offset(1, 0).Value = "" Then
Selection.Offset(1, 0).Select
Else
Selection.Offset(varNbRows, 0).Select
End If
Range("C1")(ActiveCell.Row).Value = TextBox1.Text
Range("D1")(ActiveCell.Row).Value = TextBox2.Text
Range("E1")(ActiveCell.Row).Value = TextBox2.Text
Range("F1")(ActiveCell.Row).Value = TextBox2.Text
Range("G1")(ActiveCell.Row).Value = ComboBox1.Text
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
CommandButton1.Caption = "Add Stair to stock "
CommandButton1.AutoSize = True
CommandButton1.TakeFocusOnClick = False
CommandButton1.TabStop = False
CommandButton2.Caption = "Cancel"
CommandButton2.AutoSize = True
CommandButton2.TakeFocusOnClick = False
CommandButton2.TabStop = False
ComboBox1.List = Array("ROUTES", "CUTS")
TextBox1.TabIndex = 1
TextBox2.TabIndex = 2
TextBox3.TabIndex = 3
TextBox4.TabIndex = 4
ComboBox1.TabIndex = 5
With ComboBox1
Application.SendKeys "%{down}"
End With
End Sub
I checked textbox1 properties and cannot find any difference to the
other boxes, so I don't understand why this is happening
if I want to enter a 15 it shows like this
殎5
or this, the first diget always shows up as the square thing
⎎2
掎4
Here's the codes
Option Explicit
Dim i As Integer
Private Sub CommandButton1_Click()
Dim varNbRows As Double
Range("C1").Select
varNbRows = Selection.CurrentRegion.Rows.Count
If Selection.Value = "" Then
Exit Sub
ElseIf Selection.Offset(1, 0).Value = "" Then
Selection.Offset(1, 0).Select
Else
Selection.Offset(varNbRows, 0).Select
End If
Range("C1")(ActiveCell.Row).Value = TextBox1.Text
Range("D1")(ActiveCell.Row).Value = TextBox2.Text
Range("E1")(ActiveCell.Row).Value = TextBox2.Text
Range("F1")(ActiveCell.Row).Value = TextBox2.Text
Range("G1")(ActiveCell.Row).Value = ComboBox1.Text
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
CommandButton1.Caption = "Add Stair to stock "
CommandButton1.AutoSize = True
CommandButton1.TakeFocusOnClick = False
CommandButton1.TabStop = False
CommandButton2.Caption = "Cancel"
CommandButton2.AutoSize = True
CommandButton2.TakeFocusOnClick = False
CommandButton2.TabStop = False
ComboBox1.List = Array("ROUTES", "CUTS")
TextBox1.TabIndex = 1
TextBox2.TabIndex = 2
TextBox3.TabIndex = 3
TextBox4.TabIndex = 4
ComboBox1.TabIndex = 5
With ComboBox1
Application.SendKeys "%{down}"
End With
End Sub
I checked textbox1 properties and cannot find any difference to the
other boxes, so I don't understand why this is happening