Hi
Below is my code which will create a fill effect to a wordart;
>>> use code - tags <<<
This gives below fill effect to the wordart;
My problem starts when the value of the cell goes beyond 100%. Then VBA will show error. Can there be a If Then statement which helps to restrict the Gradient position to 100% even if the cell value is >100%. If cell value is <100% then it should take value from cell itself.
Please help.
Regards
Junarkar
Below is my code which will create a fill effect to a wordart;
>>> use code - tags <<<
Code:
If wsDFD.Range("F34").Value <> olval Then
With Shapes("Rectangle 58").TextFrame2.TextRange.Font.Fill
.TwoColorGradient msoGradientHorizontal, 1
.GradientAngle = 270
.GradientStops(1).Color = RGB(79, 129, 189)
.GradientStops(1).Position = wsDFD.Range("F34").Value
.GradientStops(2).Color = RGB(166, 166, 166)
.GradientStops(2).Position = wsDFD.Range("F34").Value
End With
End If
This gives below fill effect to the wordart;
My problem starts when the value of the cell goes beyond 100%. Then VBA will show error. Can there be a If Then statement which helps to restrict the Gradient position to 100% even if the cell value is >100%. If cell value is <100% then it should take value from cell itself.
Please help.
Regards
Junarkar
Last edited by a moderator: