View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Colin Hayes Colin Hayes is offline
external usenet poster
 
Posts: 465
Default Selecting all the active cells in a named column.

In article , Roger
Govier <roger@technology4unospamdotcodotuk.? writes
Hi Colin

This sheet code will act when you double click any cell in any column, to
select from the first cell down the last cell with any entry.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Dim lr As Long, lc As Long
lc = Target.Column
lr = Cells(Rows.Count, lc).End(xlUp).Row
Range(Cells(1, lc), Cells(lr, lc)).Select
End Sub

To USE
Copy code above
Right click on sheet tabView code
Paste into the white pane that appears
Alt+F11 to return to Excel


HI Roger

Yes, this would do the trick , and is very neat , but I do need it to be
a stand alone macro to fit the circumstance I have. The sheets I'd be
applying it to would change , so a macro would be better.

Thanks again.