Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Alignments using a reference worksheet

I have a worksheet the contains the formatting data for a secon
worksheet (without getting into why, this makes the most sense, i
keeps my code very robust)...
The reference worksheet contains different columns, one column ha
color indexes for the second worksheet, the other has column width
ANOTHER HAS CELL ALIGNMENT...

when formatting my main worksheet, the code looks like:

With Range(Rangename)
.Interior.ColorIndex = ... (this line works)
.ColumnWidth = ...
.HorizontalAlignment = ..(HERE'S MY PROBLEM)
End With

The reference worksheet contains cells with either 'xlRight'
'xlCenter' or 'xlLeft'. But when the code above reads the referenc
worksheet, it looks at the values as strings instead of variable names
and doesn't understand... Does anyone know what I can do to my code s
that it understands how to read the values i the reference a
'xlRight', 'xlCenter' or 'xlLeft' insead of strings? I figure I coul
put in the actual integer values, but that'd make the worksheet ver
hard for others to read, which i'm trying to avoid.

Thanks,
Vigg

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cell Alignments using a reference worksheet

Think you will need to put in the integers unless you want to use some type
of translation/lookup table where you read the constant and translate it
into the appropriate integer for feeding to the alignment command.

--
Regards,
Tom Ogilvy


"Viggy " wrote in message
...
I have a worksheet the contains the formatting data for a second
worksheet (without getting into why, this makes the most sense, it
keeps my code very robust)...
The reference worksheet contains different columns, one column has
color indexes for the second worksheet, the other has column width,
ANOTHER HAS CELL ALIGNMENT...

when formatting my main worksheet, the code looks like:

With Range(Rangename)
Interior.ColorIndex = ... (this line works)
ColumnWidth = ...
HorizontalAlignment = ..(HERE'S MY PROBLEM)
End With

The reference worksheet contains cells with either 'xlRight',
'xlCenter' or 'xlLeft'. But when the code above reads the reference
worksheet, it looks at the values as strings instead of variable names,
and doesn't understand... Does anyone know what I can do to my code so
that it understands how to read the values i the reference as
'xlRight', 'xlCenter' or 'xlLeft' insead of strings? I figure I could
put in the actual integer values, but that'd make the worksheet very
hard for others to read, which i'm trying to avoid.

Thanks,
Viggy


---
Message posted from http://www.ExcelForum.com/



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
Reference a cell to a worksheet?????????? Ashley Excel Worksheet Functions 6 October 14th 08 03:03 PM
WORKSHEET NAME = CELL REFERENCE tim m Excel Worksheet Functions 0 October 16th 06 08:00 PM
How to reference cell in other worksheet JimDandy Excel Worksheet Functions 4 December 17th 05 06:41 PM
Worksheet reference (i.e placing worksheet name in a cell) Roger Roger Excel Worksheet Functions 1 January 20th 05 03:40 PM
Reference a cell to get worksheet name Fysh Excel Worksheet Functions 2 December 15th 04 08:57 PM


All times are GMT +1. The time now is 11:32 PM.

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"