Hi guys! I am new to vba projects. I am currently creating a userform that will show the value of a specific cell in the "Timer" sheet into the textbox1 in my userform. The cell contains time. However, whenever I try to run the userform the textbox wont show the value of the cell in "00:00:00" format. Please check the codes I'm working on below:
Please see codes below:
Private Sub commandbutton1_click() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets("Timer") sh.Range("R1").Value = "Start" If sh.Range("R2").Value = "" Then sh.Range("R2").Value = Now End If x: VBA.DoEvents If sh.Range("R1").Value = "Stop" Then Exit Sub sh.Range("R3").Value = Now Me.TextBox1.Value = sh.Range("R4").Value GoTo x End Sub
The cell shows:
T1.PNG
then textbox1 in userform shows:
T2.PNG
I already tried adding: Textbox1.value = Format("00:00:00") in the vba but it is not working. It tends to show the value of textbox1 as "12:00:00 AM"
I hope you can share your thoughts with me.
Bookmarks