Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mouse over for a button | Excel Discussion (Misc queries) | |||
the right button of mouse cant do nothing | Excel Discussion (Misc queries) | |||
Right mouse button | Excel Discussion (Misc queries) | |||
Right mouse button | Excel Worksheet Functions | |||
moving mouse highlights cells without touching left mouse button | Excel Discussion (Misc queries) |