Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default code need for time stamp

Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.

Thank's inadvance, Barry.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default code need for time stamp

ActiveCell = Time 'Time only
ActiveCell = Date & " " & Time 'Date And Time

HTH

Die_Another_Day

wildauk wrote:
Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.

Thank's inadvance, Barry.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default code need for time stamp

Range("A1") = Time 'Time only
Range("A1") = Date & " " & Time 'Date And Time

HTH


Die_Another_Day

wildauk wrote:
Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.

Thank's inadvance, Barry.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default code need for time stamp

Try this...

public sub AddTimeStamp()
activesheet.range("A1").value = now()
end sub

--
HTH...

Jim Thomlinson


"wildauk" wrote:

Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.

Thank's inadvance, Barry.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default code need for time stamp

yes that worked thank you, is there any way I can only have the time without
the date?

"Die_Another_Day" wrote:

Range("A1") = Time 'Time only
Range("A1") = Date & " " & Time 'Date And Time

HTH


Die_Another_Day

wildauk wrote:
Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.

Thank's inadvance, Barry.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default code need for time stamp

My preference is to always capture both date and time. If you want to you can
change the formatting of the cell to only display the time. If however later
on you decide that you want both then you do not need to change the code,
only to change the formatting of the cell. It gives you more flexibility to
change your mind...
--
HTH...

Jim Thomlinson


"wildauk" wrote:

yes that worked thank you, is there any way I can only have the time without
the date?

"Die_Another_Day" wrote:

Range("A1") = Time 'Time only
Range("A1") = Date & " " & Time 'Date And Time

HTH


Die_Another_Day

wildauk wrote:
Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.

Thank's inadvance, Barry.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default code need for time stamp

See first line...
"Die_Another_Day" wrote:

Range("A1") = Time 'Time only

Die_Another_Day
wildauk wrote:
yes that worked thank you, is there any way I can only have the time without
the date?

"Die_Another_Day" wrote:

Range("A1") = Time 'Time only
Range("A1") = Date & " " & Time 'Date And Time

HTH


Die_Another_Day

wildauk wrote:
Hi, I need a code for a button so when I press it the time is shown in say
cell A1 and it will not change untill I press the button agian.

Thank's inadvance, Barry.




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
Time Stamp Ken Excel Discussion (Misc queries) 2 May 5th 10 01:15 PM
Time Stamp Mike D. Excel Discussion (Misc queries) 2 May 25th 07 07:51 PM
Need help with Time Stamp Code chkoch99 Excel Programming 2 February 13th 06 02:49 PM
time stamp a cell that doesn,t change when time stamping another RC Excel Programming 5 October 13th 05 02:52 AM
Time Stamp Richard Excel Discussion (Misc queries) 4 February 2nd 05 11:16 PM


All times are GMT +1. The time now is 11:33 PM.

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"