andrewb90
Well-known Member
- Joined
- Dec 16, 2009
- Messages
- 1,077
Hello all,
I have this code that looks at the fill color of my cells and then assigns a gradient fill color to cells on another sheet. When I was testing this last week, it seemed to work quite well, now however I am getting an error, and I'm not sure what I could've done. Any help would be much appreciated.
I have this code that looks at the fill color of my cells and then assigns a gradient fill color to cells on another sheet. When I was testing this last week, it seemed to work quite well, now however I am getting an error, and I'm not sure what I could've done. Any help would be much appreciated.
Code:
Sub Reset_MasterAvail() 'This code is to copy all availability onto the scheduler after it is cleared.Dim I As Integer
Dim j As Integer
Dim objColorStop As ColorStop
Dim mySelect As Range
Dim myOthershtRng As Range
For I = 88 To 207
If I = 88 Or I = 107 Or I = 126 Or I = 145 Or I = 164 Or I = 193 Then 'skipped rows
GoTo Next1
Else
For j = 5 To 18 Step 2 ' j is column #
If Sheets("Master Availability").Cells(I, j).Interior.Color = RGB(255, 192, 0) And Sheets("Master Availability").Cells(I, j + 1).Interior.Color = RGB(255, 192, 0) Then
With Sheets("Master Availability").Cells.Select
End With
Set myOthershtRng = Sheets("Scheduler").Cells(I, j)
With myOthershtRng.Interior
.Pattern = xlPatternRectangularGradient 'Gray Gradient
.Gradient.RectangleLeft = 0.5
.Gradient.RectangleRight = 0.5
.Gradient.RectangleTop = 0.5
.Gradient.RectangleBottom = 0.5
.Gradient.ColorStops.Clear
End With
Set objColorStop = myOthershtRng.Interior.Gradient.ColorStops.Add(0)
With objColorStop
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
End With
Set objColorStop = myOthershtRng.Interior.Gradient.ColorStops.Add(1)
With objColorStop
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349009674367504
End With
End If
Next j
End If
Next1:
Next I
End Sub