Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pasting date in a range
Hi There,
I would like to Paste the Date in a cell when double clicking on it. In a limited range: like D5:D25 Underneath code does not really do it for some reason... How can I determine my range here? (eg: D5:D25) Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) If Target.Column = 1 Then Target.Value = Format(Now(), "mm-dd-yyyy") Target.Offset(0, 1).Select 'I would like to jump to the cell on the rigth afterwards End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pasting date in a range
This worked for the Range D5:D25 for me. Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVa _ Target As Range, Cancel As Boolean) ' if Column = 4 i.e. "D" & Row is between 5 and 25 If Target.Column = 4 And Target.Row 4 And Target.Row < 26 Then Target.Value = Format(Now(), "mm-dd-yyyy") Target.Offset(0, 1).Select End If End Su -- Peter8 ----------------------------------------------------------------------- Peter81's Profile: http://www.excelforum.com/member.php...fo&userid=2535 View this thread: http://www.excelforum.com/showthread.php?threadid=46781 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying Date and pasting special - DATE CHANGES?!? | Excel Worksheet Functions | |||
Copying and pasting from a range | Excel Worksheet Functions | |||
code pasting a date changes date format in current month only | Excel Programming | |||
Pasting a Range to Word | Excel Programming | |||
Help - Selecting and pasting into range | Excel Programming |