Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding Time via mouse button

I want to insert the TIME into a cell by the click of
the mouse button.

What do I neen to add to the beginning of
this formula

Sub Macro3()
'
' Keyboard Shortcut: Ctrl+x
'
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub


--
Taz


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Adding Time via mouse button

put the code into a worksheet event - double click - you sure you want to do
this?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
With Target
.FormulaR1C1 = "=NOW()"
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
End Sub


--
Cheers
Nigel



"Taz" wrote in message
. uk...
I want to insert the TIME into a cell by the click of
the mouse button.

What do I neen to add to the beginning of
this formula

Sub Macro3()
'
' Keyboard Shortcut: Ctrl+x
'
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub


--
Taz




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Adding Time via mouse button

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
With Target
.Value = Format(Time,"hh:mm:ss")
End With
Application.CutCopyMode = False
End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Nigel" wrote in message
...
put the code into a worksheet event - double click - you sure you want to

do
this?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
With Target
.FormulaR1C1 = "=NOW()"
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False
End Sub


--
Cheers
Nigel



"Taz" wrote in message
. uk...
I want to insert the TIME into a cell by the click of
the mouse button.

What do I neen to add to the beginning of
this formula

Sub Macro3()
'
' Keyboard Shortcut: Ctrl+x
'
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub


--
Taz






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Adding Time via mouse button

You can do the same thing without code by using the shortcut key - CTRL
+ SHIFT + ;

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
mouse over for a button gonger Excel Discussion (Misc queries) 1 June 19th 06 04:16 PM
the right button of mouse cant do nothing rapidito78840 Excel Discussion (Misc queries) 3 September 1st 05 01:17 PM
Right mouse button Craigshelley Excel Discussion (Misc queries) 3 August 18th 05 01:33 PM
Right mouse button Jerry S Excel Worksheet Functions 2 April 4th 05 01:37 AM
moving mouse highlights cells without touching left mouse button bremboy Excel Discussion (Misc queries) 2 January 27th 05 06:19 PM


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