Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
into I have a column of cells I want to enter the current date everytime I
click in the cell. How do I do this? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Excel doesn't have a click event that you can use. But it does have a
_beforedoubleclick and _beforerightclick. This uses the beforerightclick event: Option Explicit Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) Dim myRng As Range Set myRng = Me.Range("A:a") 'all of column A Set Target = Target.Cells(1) 'one cell only If Intersect(Target, myRng) Is Nothing Then 'do nothing Else Cancel = True 'don't show the rightclick popup menu With Target .NumberFormat = "mmmm dd, yyyy" .Value = Date End With End If End Sub Rightclick on the worksheet tab that should have this behavior. Select view code and paste this code into the newly opened code window (usually on the right hand side). Then back to excel to test it out. Tony wrote: into I have a column of cells I want to enter the current date everytime I click in the cell. How do I do this? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Control Data Entry - push entry to next cell | Excel Discussion (Misc queries) | |||
Auto entry of data based on entry of text in another column or fie | Excel Discussion (Misc queries) | |||
How do I set up entry box to auto-alphabatize each entry in list? | Excel Discussion (Misc queries) | |||
Cell Entry That Locks Selected Cells From Any Data Entry. | Excel Worksheet Functions | |||
Auto Entry in a Cell | Excel Discussion (Misc queries) |