Defining range

  • Thread starter Thread starter Edgar
  • Start date Start date
E

Edgar

Hi Experts

What is wrong with the following line of code, it jsut
wont except it.

I am trying to set the range in sheet "Email_Control"

The Range will be all cells in columns a:c with data in
them.


Worksheets("Email_Control").Range("A1:C& Cells
(Rows.Count, 1).Name = "Email_Lookup_Table"

TIA
 
Edgar,

Cells(Rows.Count, 1) will return the value in A65336 (or so). I think you
want the last row, which is

Cells(Rows.Count,"A").End(xlUp).Row
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
You also have a syntax problem
Worksheets("Email_Control").Range("A1:C & _
Cells(Rows.Count, 1).End(xlup).Row).Name = "Email_Lookup_Table"
 
Back
Top