Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a quick easy way to input time? typographically challenged Excel Worksheet Functions 2 April 17th 08 12:22 AM
I need a basic quick time line design clt64 Excel Discussion (Misc queries) 1 February 14th 08 07:46 PM
Quick Time Entry Crispy Excel Discussion (Misc queries) 1 December 5th 07 11:40 PM
Any quick key for entering Current Date and Time? Philip Excel Worksheet Functions 2 January 12th 06 04:18 PM
Any quick key to insert current Date and Time? Philip Excel Discussion (Misc queries) 2 January 12th 06 04:16 PM


All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"