Mmmm not to sure how to use that peice of code, i'm still learning vb.Here's what i have so far.
VB Code:
Dim lCurrentRow As Long Private Sub CommandButton1_Click() Dim LastRow As Object lCurrentRow = lCurrentRow + 1 ' Show contents of new row in the form: TextBox2.Text = Cells(lCurrentRow, 1).Value Set LastRow = Sheet4.Range("B65536").End(xlUp) LastRow.Offset(1, 0).Value = TextBox1.Value MsgBox "One code written to Optimo stop Codes" response = MsgBox("Do you want to enter another down time code?", _ vbYesNo) If response = vbYes Then TextBox1.Text = "" TextBox1.SetFocus Else Unload Me End If ' Increment row number: ' Show contents of new row in the form: TextBox2.Text = Cells(lCurrentRow, 1).Value End Sub Private Sub UserForm_Active() ' Read initial values from Row 1: TextBox2.Text = Cells(1, 2).Value ' Read initial values from Row 1: lCurrentRow = 1 TextBox2.Text = Cells(lCurrentRow, 1).Value End Sub
So far it works the information is displayed in the textbox2 label but the formating is wrong, It's displaying 21:35:00 as 0.5416666666666.
how can i change this.?




Reply With Quote