hi,
how can I add the day and month like 29.03 when I double click any cell in column D ?
regards
hi,
how can I add the day and month like 29.03 when I double click any cell in column D ?
regards
[VBA]Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Selection.Count > 1 Then Exit Sub
If Target.Column = 4 Then
Target.NumberFormat = "dd/mm"
Target.Value = Date
Cancel = True
End If
End Sub[/VBA]Charlize
Hi, format column D as custom and then dd.mm then add this to the worksheet code module:
[VBA]
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("D")) Is Nothing Then
Target.Value = Date
Cancel = True
End If
End Sub
[/VBA]Regards,
Simon
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
hi,
charlize's and yours does not work, what is the problem ?
Works fine for me!, post your workbok or example workbook!
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)
hi,
please check the attached file.code is in module 4
regards
hi,
charlizes works.I changed the place of code.yours has format problem
thanks
Aoc, the code supplied by both myself and Charlize was to be placed in the Worksheet code module NOT a standard module as per our instructions!
Regards,
Simon
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)