Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / April 2008

Tip: Looking for answers? Try searching our database.

How do I specify different BackColor for each cell in a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Suji - 10 Apr 2008 11:41 GMT
I have a table with many rows and columns.  Based of certain criteria, I am
trying to give different Backcolor to each cell, i.e. to hightlight certain
events.

My code looks like (in a loop):

For iRow = 1 To ppTextBoxItem.Table.Rows.Count
  For iColumn = 1 To ppTextBoxItem.Table.Columns.Count
        ppTextBoxItem.Table.Cell(iRow, iColumn).Shape.Fill.Visible = True
        ppTextBoxItem.Table.Cell(iRow, iColumn).Shape.Fill.BackColor.RGB =
iBackColor          
  Next
Next

The above code is not working as it retains the original backcolor of the
cell i.e. does not change to new specified color.
John Wilson - 10 Apr 2008 12:22 GMT
This may seem counter intuative but you should use .Forecolor
Signature

Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

> I have a table with many rows and columns.  Based of certain criteria, I am
> trying to give different Backcolor to each cell, i.e. to hightlight certain
[quoted text clipped - 12 lines]
> The above code is not working as it retains the original backcolor of the
> cell i.e. does not change to new specified color.
Suji - 10 Apr 2008 13:05 GMT
I tried using the .ForeColor, and it works now on  a textbox.

But still does not work on a Table Cells within a textbox.  

> This may seem counter intuative but you should use .Forecolor
>
[quoted text clipped - 14 lines]
> > The above code is not working as it retains the original backcolor of the
> > cell i.e. does not change to new specified color.
Suji - 10 Apr 2008 13:11 GMT
Many Thanks John.  Actually, it works now.  I tried it on a different table.  
The original table I had, might have some other properties set, which was
stopping it from happening.   So your solution was great, Cheers!

> This may seem counter intuative but you should use .Forecolor
>
[quoted text clipped - 14 lines]
> > The above code is not working as it retains the original backcolor of the
> > cell i.e. does not change to new specified color.
John Wilson - 10 Apr 2008 13:43 GMT
That's great!

It's best to think of fore and backcolor as color1 and color2. You would
only use backcolor in eg a two color gradient or a pattern
Signature

Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

> Many Thanks John.  Actually, it works now.  I tried it on a different table.  
> The original table I had, might have some other properties set, which was
[quoted text clipped - 18 lines]
> > > The above code is not working as it retains the original backcolor of the
> > > cell i.e. does not change to new specified color.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.