Alternate Shading for non-bold rows

A

andreashermle

Dear Experts:

below code snippet (taken from a macro to alternately shade rows:
Courtesy by Chris Bottomley, EE) should be CHANGED to work on rows
that have NO BOLD FONT FORMATTING instead of a "IsNumeric" property.
Hope this is feasible.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas



Code snippet cut out from a macro to shade rows:

For Each rw In Selection.Rows
If IsNumeric(ThisWorkbook.Sheets(1).Cells(rw.Row, 1))
Then
For Each col In Selection.Columns
If bolRed Then
ThisWorkbook.Sheets(1).Cells(rw.Row,
col.Column).Interior.Color = RGB(239, 211, 210)
ThisWorkbook.Sheets(1).Cells(rw.Row,
col.Column).Font.Color = vbBlack
Else
ThisWorkbook.Sheets(1).Cells(rw.Row,
col.Column).Interior.Color = RGB(229, 229, 229)
ThisWorkbook.Sheets(1).Cells(rw.Row,
col.Column).Font.Color = vbBlack
End If
Next
 
J

joel

Your is only checking column A for shading

from
If IsNumeric(ThisWorkbook.Sheets(1).Cells(rw.Row, 1))

to
if ThisWorkbook.Sheets(1).Cells(rw.Row,1).interior.colorindex <
xlnone
 
A

andreashermle

Your is only checking column A for shading

from
If IsNumeric(ThisWorkbook.Sheets(1).Cells(rw.Row, 1))

to
if ThisWorkbook.Sheets(1).Cells(rw.Row,1).interior.colorindex <>
xlnone

--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:http://www.thecodecage.com/forumz/showthread.php?t=190077

http://www.thecodecage.com/forumz

Hi Joel,

thank you very much for your tip. It help me to solve my problem.

Thank you again. Regards, Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top