View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Selecting all cells using macro

Sub setnamerange()
'last row in col A
lr = Cells(Rows.Count, "a").End(xlUp).Row

Set myrng = Range(Cells(1, "a"), Cells(lr, "a"))
myrng.copy 'Select
End Sub

--
Don Guillett
SalesAid Software

"robertlewis" wrote in message
...
I need to be able to select a range of cells from the first (A1) to the
last
active cell. I know there is a Go To.... / Special Cells option but I need
a
statement to do this that I can use in a macro. If possible I would like
to
give this a name (eg-"All_Active_Cells" so that I can reference it easily
in
the macro.
Thanks
Robert