Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Reference a Column by Number

I have a single cell named range called DateCreated_lbl. I'd like to
apply formatting to the entire column but can't seem to figure out the
proper syntax.

The following did not work:

Range(DateCreated_lbl).Column.ColumnWidth = 16

Columns.Range(DateCreated_lbl).ColumnWidth = 16

Is there a simple way?

Thanks

- John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Reference a Column by Number

False Alarm. I figured it out. I was close but not quite there...

Columns(Range("DateCreated_lbl").Column).ColumnWid th = 16

- John

John Michl wrote:
I have a single cell named range called DateCreated_lbl. I'd like to
apply formatting to the entire column but can't seem to figure out the
proper syntax.

The following did not work:

Range(DateCreated_lbl).Column.ColumnWidth = 16

Columns.Range(DateCreated_lbl).ColumnWidth = 16

Is there a simple way?

Thanks

- John


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reference a Column by Number

Assuming if I did Insert=Name=Define, I would see a named range with the
name DateCreated_lbl, then

Range("DateCreated_lbl").EntireColumn.ColumnWidth = 16

--
Regards,
Tom Ogilvy

"John Michl" wrote in message
oups.com...
I have a single cell named range called DateCreated_lbl. I'd like to
apply formatting to the entire column but can't seem to figure out the
proper syntax.

The following did not work:

Range(DateCreated_lbl).Column.ColumnWidth = 16

Columns.Range(DateCreated_lbl).ColumnWidth = 16

Is there a simple way?

Thanks

- John



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reference a Column by Number

That works but is still only close <g

--
Regards,
Tom Ogilvy


"John Michl" wrote in message
oups.com...
False Alarm. I figured it out. I was close but not quite there...

Columns(Range("DateCreated_lbl").Column).ColumnWid th = 16

- John

John Michl wrote:
I have a single cell named range called DateCreated_lbl. I'd like to
apply formatting to the entire column but can't seem to figure out the
proper syntax.

The following did not work:

Range(DateCreated_lbl).Column.ColumnWidth = 16

Columns.Range(DateCreated_lbl).ColumnWidth = 16

Is there a simple way?

Thanks

- John




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Reference a Column by Number

Thanks Tom. My version works but yours makes more sense!

- John


Tom Ogilvy wrote:
Assuming if I did Insert=Name=Define, I would see a named range with the
name DateCreated_lbl, then

Range("DateCreated_lbl").EntireColumn.ColumnWidth = 16

--
Regards,
Tom Ogilvy

"John Michl" wrote in message
oups.com...
I have a single cell named range called DateCreated_lbl. I'd like to
apply formatting to the entire column but can't seem to figure out the
proper syntax.

The following did not work:

Range(DateCreated_lbl).Column.ColumnWidth = 16

Columns.Range(DateCreated_lbl).ColumnWidth = 16

Is there a simple way?

Thanks

- John


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
Calculate row/column number in reference formula mirin Excel Worksheet Functions 2 November 11th 09 03:16 PM
Reference a number from a different column in a formula rhhince[_2_] Excel Worksheet Functions 2 November 9th 08 11:15 PM
Selecting a range using a column number reference PCLIVE Excel Programming 7 October 14th 05 04:59 PM
chart label reference based on the column number bj Charts and Charting in Excel 0 May 20th 05 07:18 PM
reference to column (not known) and certain row number gaba Excel Programming 3 November 15th 04 01:34 PM


All times are GMT +1. The time now is 10:48 AM.

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

About Us

"It's about Microsoft Excel"