Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default VB script for Current time

Hi there,
I wanted current time to be dispalyed in active cell. So I created a
Command button and wrote the following script, though its working
fine, when ever i click the button, time in all the cells are getting
updated to current time. But I want the current time only in cell
where cursor is there. Can any one assit please...
Scrip:-
sub
commondbutton1_Click
activecell.formula="=now()"
end sub

Thanks in advance!
Sriki
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default VB script for Current time

That is because you are putting the formula
=NOW() in the cells

Use
Private Sub CommandButton1_Click()
ActiveCell = Now()
End Sub

----------------------
Click 'Yes' if this helps.

" wrote:

Hi there,
I wanted current time to be dispalyed in active cell. So I created a
Command button and wrote the following script, though its working
fine, when ever i click the button, time in all the cells are getting
updated to current time. But I want the current time only in cell
where cursor is there. Can any one assit please...
Scrip:-
sub
commondbutton1_Click
activecell.formula="=now()"
end sub

Thanks in advance!
Sriki

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default VB script for Current time

On Jun 1, 11:04*pm, Sheeloo wrote:
That is because you are putting the formula
=NOW() in the cells

Use
Private Sub CommandButton1_Click()
ActiveCell = Now()
End Sub

----------------------
Click 'Yes' if this helps.



" wrote:
Hi there,
I wanted current time to be dispalyed in active cell. So I created a
Command button and wrote the following script, though its working
fine, when ever i click the button, time in all the cells are getting
updated to current time. But I want the current time only in cell
where cursor is there. Can any one assit please...
Scrip:-
sub
commondbutton1_Click
activecell.formula="=now()"
end sub


Thanks in advance!
Sriki- Hide quoted text -


- Show quoted text -


Thank you so very much.. It's working...
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
Current Time albertmb Excel Discussion (Misc queries) 11 February 22nd 09 06:43 AM
In Excel: is there a way of inserting the current time (what time it is right NOW) [email protected] Excel Discussion (Misc queries) 2 May 20th 07 11:35 PM
Having the current time inserted w/o updating the current time sherobot Excel Worksheet Functions 2 October 2nd 06 05:05 PM
Button/Script to create a new workbook from a current one. downer Excel Worksheet Functions 0 February 17th 06 09:09 PM
Can I automatically enter the current date or current time into a Ben New Users to Excel 7 October 19th 05 03:38 PM


All times are GMT +1. The time now is 10:59 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"