View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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/