Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Copying Date and pasting special - DATE CHANGES?!? David Excel Worksheet Functions 5 January 15th 10 11:21 PM
Copying and pasting from a range John Excel Worksheet Functions 3 June 6th 07 05:22 PM
code pasting a date changes date format in current month only Edward[_5_] Excel Programming 0 May 10th 04 06:13 PM
Pasting a Range to Word Ian Mangelsdorf Excel Programming 0 January 22nd 04 12:34 AM
Help - Selecting and pasting into range amonymous Excel Programming 4 January 21st 04 12:21 AM


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