K
K1KKKA
Am using the code below to show data entered into Sheet "T", but in
each textbox i would only like to see 2 decimal points, how would i
achieve this, can not see how in the properties box in Vb, was
expecting it to be that easy. i presumed using the "format ( date,
dd,mmm,yy) would fix this, but maybe im using it wrong?
any help please!!
Steve
===============================
Private Sub ComboBox1_Change()
Dim iRow As Long
With Me
iRow = .ComboBox1.ListIndex + 7
.TextBox1.Text = Worksheets("T").Cells(iRow, "c").Value
.TextBox2.Text = Worksheets("T").Cells(iRow, "d").Value
.TextBox3.Text = Worksheets("T").Cells(iRow, "e").Value
.TextBox4.Text = Worksheets("T").Cells(iRow, "f").Value
.TextBox5.Text = Worksheets("T").Cells(iRow, "p").Value
.TextBox6.Text = Worksheets("T").Cells(iRow, "q").Value
.TextBox7.Text = Worksheets("T").Cells(iRow, "u").Value
.TextBox8.Text = Worksheets("T").Cells(iRow, "x").Value
.TextBox9.Text = Worksheets("T").Cells(iRow, "y").Value
.TextBox10.Text = Worksheets("T").Cells(iRow, "z").Value
.TextBox11.Text = Worksheets("T").Cells(iRow, "ac").Value
.TextBox12.Text = Worksheets("T").Cells(iRow, "ad").Value
.TextBox13.Text = Worksheets("T").Cells(iRow, "ae").Value
.TextBox14.Text = Worksheets("T").Cells(iRow, "ag").Value
.TextBox15.Text = Worksheets("T").Cells(iRow, "ah").Value
.TextBox16.Text = Worksheets("T").Cells(iRow, "ai").Value
.TextBox17.Text = Worksheets("T").Cells(iRow, "aj").Value
.TextBox18.Text = Worksheets("T").Cells(iRow, "al").Value
End With
End Sub
-----------------------------------------------------------------------------------------------------
Private Sub UserForm_Activate()
Dim iLastRow As Long
Dim i As Long
With Worksheets("T")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
Me.ComboBox1.Clear
For i = 7 To iLastRow
Me.ComboBox1.AddItem .Cells(i, "A").Value
Next i
End With
End Sub
each textbox i would only like to see 2 decimal points, how would i
achieve this, can not see how in the properties box in Vb, was
expecting it to be that easy. i presumed using the "format ( date,
dd,mmm,yy) would fix this, but maybe im using it wrong?
any help please!!
Steve
===============================
Private Sub ComboBox1_Change()
Dim iRow As Long
With Me
iRow = .ComboBox1.ListIndex + 7
.TextBox1.Text = Worksheets("T").Cells(iRow, "c").Value
.TextBox2.Text = Worksheets("T").Cells(iRow, "d").Value
.TextBox3.Text = Worksheets("T").Cells(iRow, "e").Value
.TextBox4.Text = Worksheets("T").Cells(iRow, "f").Value
.TextBox5.Text = Worksheets("T").Cells(iRow, "p").Value
.TextBox6.Text = Worksheets("T").Cells(iRow, "q").Value
.TextBox7.Text = Worksheets("T").Cells(iRow, "u").Value
.TextBox8.Text = Worksheets("T").Cells(iRow, "x").Value
.TextBox9.Text = Worksheets("T").Cells(iRow, "y").Value
.TextBox10.Text = Worksheets("T").Cells(iRow, "z").Value
.TextBox11.Text = Worksheets("T").Cells(iRow, "ac").Value
.TextBox12.Text = Worksheets("T").Cells(iRow, "ad").Value
.TextBox13.Text = Worksheets("T").Cells(iRow, "ae").Value
.TextBox14.Text = Worksheets("T").Cells(iRow, "ag").Value
.TextBox15.Text = Worksheets("T").Cells(iRow, "ah").Value
.TextBox16.Text = Worksheets("T").Cells(iRow, "ai").Value
.TextBox17.Text = Worksheets("T").Cells(iRow, "aj").Value
.TextBox18.Text = Worksheets("T").Cells(iRow, "al").Value
End With
End Sub
-----------------------------------------------------------------------------------------------------
Private Sub UserForm_Activate()
Dim iLastRow As Long
Dim i As Long
With Worksheets("T")
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
Me.ComboBox1.Clear
For i = 7 To iLastRow
Me.ComboBox1.AddItem .Cells(i, "A").Value
Next i
End With
End Sub