Scooter172
06-17-2010, 01:22 PM
I have been trying to assign a user form to update cells within a workbook, But am having problems with the time format in tbxTimeswap. It displays the time in this format 03:18:57 PM and I want it in 03:18 PM Private Sub cmdSubmit_Click()
With Sheets(1)
.Range("B2").Value = tbxEmployeeNum
tbxEmployeeNum = Empty
frmDataEntry.Hide
.Range("A1").Value = tbxLRV1
tbxLRV1 = Empty
.Range("A2").Value = tbxLRV2
tbxLRV2 = Empty
.Range("A3").Value = tbxLRV3
tbxLRV3 = Empty
.Range("B1").Value = tbxRunNum
tbxRunNum = Empty
.Range("B4").Value = tbxLoc
tbxLoc = Empty
.Range("A1").Value = tbxNewLrv1
tbxNewLrv1 = Empty
.Range("A2").Value = tbxNewLrv2
tbxNewLrv2 = Empty
.Range("A3").Value = tbxNewLrv3
tbxNewLrv3 = Empty
.Range("E8,C4").Value = tbxTimeswap
Me.tbxTimeswap.Value = Format(Time())
.Range("C1").Value = tbxTripNum
tbxTripNum = Empty
frmDataEntry.Hide
End With
End Sub
With Sheets(1)
.Range("B2").Value = tbxEmployeeNum
tbxEmployeeNum = Empty
frmDataEntry.Hide
.Range("A1").Value = tbxLRV1
tbxLRV1 = Empty
.Range("A2").Value = tbxLRV2
tbxLRV2 = Empty
.Range("A3").Value = tbxLRV3
tbxLRV3 = Empty
.Range("B1").Value = tbxRunNum
tbxRunNum = Empty
.Range("B4").Value = tbxLoc
tbxLoc = Empty
.Range("A1").Value = tbxNewLrv1
tbxNewLrv1 = Empty
.Range("A2").Value = tbxNewLrv2
tbxNewLrv2 = Empty
.Range("A3").Value = tbxNewLrv3
tbxNewLrv3 = Empty
.Range("E8,C4").Value = tbxTimeswap
Me.tbxTimeswap.Value = Format(Time())
.Range("C1").Value = tbxTripNum
tbxTripNum = Empty
frmDataEntry.Hide
End With
End Sub