View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default Selecting all the active cells in a named column.

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
--
Regards
Roger Govier

"Colin Hayes" wrote in message
...


Hi

I have a small problem. I need to have a macro which can fulfil the
following , if possible.

I need to select all the cells in a named column. Not the whole column ,
but just those cells with content.

Perhaps the macro could request the column to act on , and then the macro
would select from cell 1 down to the last cell with content.

Can someone help with this?

Grateful for any advice.



Best Wishes

__________ Information from ESET Smart Security, version of virus
signature database 4530 (20091021) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 4530 (20091021) __________

The message was checked by ESET Smart Security.

http://www.eset.com