Hi all,
I have a text box on a userform that I’m trying to use for both display of a cell from the sheet and as an input back to the cell. The problem is that the cell formatted as Time (13:30). I’ve tried different formats with same results. The textbox displays the TimeSerial instead of the time in the cell.
I initialize the userform by reading the cell (StartTime) and converting with Hour() and Minute() functions. The textbox displays properly except for one minor flaw. If the minutes end in a zero, it only displays one digit. Eg cell has 8:20, textbox shows 8:1.
If VBA had a Time format it would be nice, but what that does is the same as Now(). That is not what I want. I have several other cells on the sheet that have to have times put on them and I’m going to have the same problem. These times are start and finish time that a user puts in as a basis for a project time tracker. These are not running clock times, just times. I use these entries for time calculations all over the sheet, so I just can’t put a text format out there.
I have found tons of stuff for manipulating dates, but very, very little about time on sheets and in VBA. Is there a way to display time and entry properly in a userform textbox?Can anyone help, please. I hate being stymied just because Micosoft’s conversion doesn’t act as advetised.
TIA
Heisenberg was probably right.
I have a text box on a userform that I’m trying to use for both display of a cell from the sheet and as an input back to the cell. The problem is that the cell formatted as Time (13:30). I’ve tried different formats with same results. The textbox displays the TimeSerial instead of the time in the cell.
I initialize the userform by reading the cell (StartTime) and converting with Hour() and Minute() functions. The textbox displays properly except for one minor flaw. If the minutes end in a zero, it only displays one digit. Eg cell has 8:20, textbox shows 8:1.
If VBA had a Time format it would be nice, but what that does is the same as Now(). That is not what I want. I have several other cells on the sheet that have to have times put on them and I’m going to have the same problem. These times are start and finish time that a user puts in as a basis for a project time tracker. These are not running clock times, just times. I use these entries for time calculations all over the sheet, so I just can’t put a text format out there.
I have found tons of stuff for manipulating dates, but very, very little about time on sheets and in VBA. Is there a way to display time and entry properly in a userform textbox?Can anyone help, please. I hate being stymied just because Micosoft’s conversion doesn’t act as advetised.
TIA
Heisenberg was probably right.