Thread: Macro Commands
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
danh
 
Posts: n/a
Default Macro Commands

Thanks Kassie for your help. As you say I can use the Conditional Formatting
but unfortunately the spreadsheet I need to format comes from another system
and is exported to excel. So the spreadsheet always changes. I have to run
a macro command to see how many rows there are in the spreadsheet and then
format it according the the code in Col G. It is the only col. that will
always contain the code.
Can somebody help me?
Thanks,
Danielle

"kassie" wrote:

Have you tried conditional formatting? Say your code is in G1. Click on
Format|Conditional Format, click the down arrow next to Cell Value, select
Formula is, and type in =$G1="B" do formatting, click on Add, enter =$G1="W"
and do formatting. Use the painter to format the rest of the row, or else
select the row, and then do conditional formatting. Use the painter to
format the other rows. That means you do not have to run a macro.

"danh" wrote:

I need to read through each row in an Excel Worksheet and format it depending
on a code in Col G. If Code is B then the Cell in Col A must be bold. If
the Code is W, then whole row when there is data must be Font Color White and
Fill Color Purple.
I don't know how to make macro commands read each row at a time until it
reaches the last row and format it accordingly. I suppose it must be in a
loop. Can somebody help me?
Thanks,
Danielle