wrong font

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
 
D

damorrison

I did a test, and if I delete textbox1, and then bring up the userform
the first digit in textbox2 shows the same square thing, I have no Idea
what that square thing is called .
 
D

damorrison

Okay,
I just tried this out on another computer, and it worked fine for the
first three times and then it started again with the first digit on the
first textbox being a square, this time when I hit 8 or 9 it appeared
to be chinese or something to that effect, but usually it was a square
 
B

bruceceng

try using TextBox1.value instead. If this doesn't work try using
val(TextBox1.value) or ltrim$(rtrim$(TextBox1.Text)).
 
D

damorrison

try using TextBox1.value instead. If this doesn't work try using
val(TextBox1.value) or ltrim$(rtrim$(TextBox1.Text)).

Thanks,
I decided to use the properties box instead of using code and the
problem disappeared
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top