Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- Rob van Gelder - http://www.vangelder.co.nz/excel "RJH" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rob,
My mistake, to the right is where I was going. Thanks! It works great! Bob Howard "Rob van Gelder" wrote in message ... 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 -- Rob van Gelder - http://www.vangelder.co.nz/excel "RJH" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell requires double click to 'activate' date format change | Excel Discussion (Misc queries) | |||
Need to double-click for data to be recognised as date?! | Excel Discussion (Misc queries) | |||
double click insert date | Excel Worksheet Functions | |||
double click a cell with Date format | Excel Discussion (Misc queries) | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel |