Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quick Q about time in VBA
I have a form, when the user presses a button it writes
the time into a textbox, I then write the data in the textbox to a datatable. The for activate event loads up the data from the data table, when the value comes back in its as a fraction, how do i convert the fraction to a valid time ? I have looked in the help but couldnt pin it down :( |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quick Q about time in VBA
Hi Tom
Ok noted, but can you explain why? Is this also true with defined names? eg: [MyName].ClearContents Thanks Regards Pascal "Tom Ogilvy" a écrit dans le message de ... If you are happy with the way it looks on the sheet: Me.TextBox1.Value = Sheets("Feuil3").Range("A3").Text would be an option as well. Note that using [A3] vice Range("A3") is three times slower. -- Regards, Tom Ogilvy "papou" <nspm wrote in message ... Hello Neil Use Format to convert into a time format ie: Me.TextBox1.Value = Format(Sheets("Feuil3").[A3], "HH:MM") HTH Regards Pascal "Neil" a écrit dans le message de ... I have a form, when the user presses a button it writes the time into a textbox, I then write the data in the textbox to a datatable. The for activate event loads up the data from the data table, when the value comes back in its as a fraction, how do i convert the fraction to a valid time ? I have looked in the help but couldnt pin it down :( |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quick Q about time in VBA
[ ] is equivalent to evaluate. You are asking Excel to evaluate the
expression in the brackets. This is slower than just having VBA use the object reference. I would assume the same would be true for defined names, although I haven't tested it. I did test the range reference. -- Regards, Tom Ogilvy "papou" <nspm wrote in message ... Hi Tom Ok noted, but can you explain why? Is this also true with defined names? eg: [MyName].ClearContents Thanks Regards Pascal "Tom Ogilvy" a écrit dans le message de ... If you are happy with the way it looks on the sheet: Me.TextBox1.Value = Sheets("Feuil3").Range("A3").Text would be an option as well. Note that using [A3] vice Range("A3") is three times slower. -- Regards, Tom Ogilvy "papou" <nspm wrote in message ... Hello Neil Use Format to convert into a time format ie: Me.TextBox1.Value = Format(Sheets("Feuil3").[A3], "HH:MM") HTH Regards Pascal "Neil" a écrit dans le message de ... I have a form, when the user presses a button it writes the time into a textbox, I then write the data in the textbox to a datatable. The for activate event loads up the data from the data table, when the value comes back in its as a fraction, how do i convert the fraction to a valid time ? I have looked in the help but couldnt pin it down :( |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
is there a quick easy way to input time? | Excel Worksheet Functions | |||
I need a basic quick time line design | Excel Discussion (Misc queries) | |||
Quick Time Entry | Excel Discussion (Misc queries) | |||
Any quick key for entering Current Date and Time? | Excel Worksheet Functions | |||
Any quick key to insert current Date and Time? | Excel Discussion (Misc queries) |