Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I code a cell to display the current date on double-click?

Hi, I want to be able to have the current date entered into a given
cell, when I double-click it.

It will always be a cell, in one particular column, reserved for date.
Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How do I code a cell to display the current date on double-click?

Hi,

Write the BeforeDoubleClick of worksheet as follow:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Target.Column = 2 Then' for second(B) column
Target.Value = Now()
End If
End Sub

Regards,

Vinit


George wrote:
Hi, I want to be able to have the current date entered into a given
cell, when I double-click it.

It will always be a cell, in one particular column, reserved for

date.
Jim


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default How do I code a cell to display the current date on double-click?

If the cell for your date is range named, say "main.date" then your
doubleclick event is easier to follow

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel
As Boolean)
Dim rDate As Range
Set rDate = ThisWorkbook.Names.Item("main.date").RefersToRange
If Target.Address = rDate.Address Then
Cancel = True
Target.Value = Now
End If
End Sub

HTH
Patrick Molloy
Microsoft Excel MVP

"George" wrote:

Hi, I want to be able to have the current date entered into a given
cell, when I double-click it.

It will always be a cell, in one particular column, reserved for date.
Jim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How do I code a cell to display the current date on double-click?

Application.intersect () can also help to check the activecell in a
range

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How do I code a cell to display the current date on double-click?


Yes, this example below seems to work just fine.
Please tell me, I'd like to know how to write this stuff, but I can't
learn it on my own. Is there a site or a good book, loaded with such
macro/module examples?

Thanks,
Jim

Hi,

Write the BeforeDoubleClick of worksheet as follow:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Target.Column = 2 Then' for second(B) column
Target.Value = Now()
End If
End Sub

Regards,

Vinit


George wrote:
Hi, I want to be able to have the current date entered into a given
cell, when I double-click it.

It will always be a cell, in one particular column, reserved for

date.
Jim





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How do I code a cell to display the current date on double-click?

On Fri, 13 May 2005 04:28:18 GMT,
(George) wrote:

Hi, I want to be able to have the current date entered into a given
cell, when I double-click it.

It will always be a cell, in one particular column, reserved for date.
Jim


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default How do ... display current date on double-click? -- Use Ctrl;

Hi George,

why not just use the shortcut key for current date?

Ctrl ; -- Current Date
Ctrl Shift : -- Current Time
Ctrl ;, then SPACE, then Ctrl Shift : -- current date and time together


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



George C. wrote:
On Fri, 13 May 2005 04:28:18 GMT,
(George) wrote:

Hi, I want to be able to have the current date entered into a given
cell, when I double-click it.

It will always be a cell, in one particular column, reserved for date.
Jim


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
Cell requires double click to 'activate' date format change BLTibbs Excel Discussion (Misc queries) 4 April 2nd 23 01:38 PM
How to make the current date appear when i click 'enter' in a cell Matt_07 Excel Worksheet Functions 1 January 30th 07 09:32 AM
Click a cell and update to current time / date ? Eric Excel Discussion (Misc queries) 3 October 4th 06 12:12 AM
double click a cell with Date format qqxz Excel Discussion (Misc queries) 1 January 24th 06 02:41 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM


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