Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default adding date with double click

hi,

how can I add the day and month like 29.03 when I double click any cell in
column D ?

regards
--
SAHRAYICEDIT-ISTANBUL
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default adding date with double click

Paste this in Worksheet code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Intersect(Target, Range("D:D")) Is Nothing Then
Else
Target.Value = Now()
Target.NumberFormat = "dd.mm"
End If
Cancel = True
End Sub
--
Gary''s Student - gsnu200714


"excel-tr" wrote:

hi,

how can I add the day and month like 29.03 when I double click any cell in
column D ?

regards
--
SAHRAYICEDIT-ISTANBUL

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default adding date with double click

Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 4 Then
Target.Value = Format(Date, "dd.mm")
End If
Cancel = True
enditall:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the above into that sheet module.


Gord Dibben MS Excel MVP


On Mon, 9 Apr 2007 12:34:03 -0700, excel-tr
wrote:

hi,

how can I add the day and month like 29.03 when I double click any cell in
column D ?

regards


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
How do I code a cell to display the current date on double-click? George[_27_] Excel Programming 6 December 10th 06 09:26 AM
Need to double-click for data to be recognised as date?! HierkommtdieMau Excel Discussion (Misc queries) 3 March 28th 06 11:17 AM
double click insert date Slobodan Excel Worksheet Functions 1 February 16th 06 01:28 PM
double click a cell with Date format qqxz Excel Discussion (Misc queries) 1 January 24th 06 02:41 PM
Double-click date entry RJH Excel Programming 2 January 30th 04 04:41 PM


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