There use to be a KB that allowed you to left click a cell and the number one (1) would go in to the cell. Does anyone remeber this particular KB entry???
Best regards,
Charlie
There use to be a KB that allowed you to left click a cell and the number one (1) would go in to the cell. Does anyone remeber this particular KB entry???
Best regards,
Charlie
Put this in the code module for the sheet in question and 1 will be entered into a cell if it is Double-Clicked.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean) Target.Value = 1 Cancel = True End Sub
Thanks "mikerickson" how's your day? A you the same "mikerickson" that'son MrExcel? Thanks for you reply. If I wanted to set a range for instance A1:B20 and C10 to F10 were owuld this get placed?
Best regards,
Charlie
[vba]Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
Dim Tgt As Range
Set Tgt = Union(Range("A1:B20"), Range("C10:F10"))
If Not Intersect(Target, Tgt) Is Nothing Then
Target.Value = 1
End If
Cancel = True
End Sub
[/vba]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Thanks mdmackillop for youe suggestion.
Best regards,
Charlie