Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Defining range

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Defining range

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)

"Edgar" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Defining range

You also have a syntax problem
Worksheets("Email_Control").Range("A1:C & _
Cells(Rows.Count, 1).End(xlup).Row).Name = "Email_Lookup_Table"

--
Regards,
Tom Ogilvy


"Edgar" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Defining Range Name anshu[_2_] Excel Discussion (Misc queries) 2 July 22nd 07 07:30 AM
help defining dynamic range joecrabtree Charts and Charting in Excel 0 December 6th 06 03:33 PM
Defining a range Don Excel Worksheet Functions 1 February 25th 05 03:54 PM
Defining a range Matt Excel Programming 3 January 23rd 04 03:21 PM
Defining Range MAB[_5_] Excel Programming 2 September 15th 03 02:48 PM


All times are GMT +1. The time now is 03:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"