sksanjeev786
Well-known Member
- Joined
- Aug 5, 2020
- Messages
- 961
- Office Version
- 365
- 2016
- Platform
- Windows
Hi Team
I have a below macro but I need condition between
1. =+10 and above Green
2. =-10 and above = Red
3.=+5 and +9= light green
4.=-5 and -9 =light Red.
and also while running this below macro it is running for all slide I need for certain slides like (slide 6,10,12)
Thanks in advance.
I have a below macro but I need condition between
1. =+10 and above Green
2. =-10 and above = Red
3.=+5 and +9= light green
4.=-5 and -9 =light Red.
and also while running this below macro it is running for all slide I need for certain slides like (slide 6,10,12)
Thanks in advance.
Rich (BB code):
Sub colorformat()
Dim s As Slide
Dim oSh As Shape
Dim oTbl As Table
Dim lRow As Long
Dim lCol As Long
Dim cell As ReflectionFormat
For Each s In ActivePresentation.Slides
For Each oSh In s.Shapes
If oSh.HasTable Then
Set oTbl = oSh.Table
For lRow = 2 To oTbl.Rows.Count
For lCol = 3 To oTbl.Columns.Count
If IsNumeric(oTbl.cell(lRow, lCol).Shape.TextFrame.TextRange) = True Then
If oTbl.cell(lRow, lCol).Shape.TextFrame.TextRange >= 5 Then
oTbl.cell(lRow, lCol).Shape.Fill.ForeColor.RGB = RGB(102, 228, 102)
oTbl.cell(lRow, lCol).Shape.TextFrame.TextRange.Font.Color.RGB = RGB(255, 255, 255)
Else
If oTbl.cell(lRow, lCol).Shape.TextFrame.TextRange <= -5 Then
oTbl.cell(lRow, lCol).Shape.Fill.ForeColor.RGB = RGB(237, 102, 102)
oTbl.cell(lRow, lCol).Shape.TextFrame.TextRange.Font.Color.RGB = RGB(255, 255, 255)
Else
If oTbl.cell(lRow, lCol).Shape.TextFrame.TextRange = Null Then
End If
End If
End If
End If
Next
Next
End If
Next ' Shape
Next s
End Sub
Last edited by a moderator: