Double-click date entry

R

RJH

I can get the code below to work in any cell I double-click in. I would
like to limit the double-click event to column 1 only. The rest of the
sheet should function as normal. How do I limit the date entry to to a
single column and then have the active cell jump automatically one column to
the left?

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target As Range, Cancel As Boolean)
ActiveCell.Value = Format(Now(), "mm-dd-yyyy")
End Sub

Thanks for your help!

Bob Howard
 
R

Rob van Gelder

Bob,

There are no columns left of column 1 :)

This example selects 1 column to the right:

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
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top