I am trying to write a module that changes the color of specific cells. I keep on getting this error 91. I have highlighted in blue where the error is. I do have a blank spreadsheet open currently. Any help would be appreciated.
Code:
Public Sub xLFmtFillColorRed(intTopRow As Integer, intBotRow As Integer, intLCol As Integer, intRCol As Integer)
' ****************************************************************************************************
' *** THIS SUB FILLS IN THE COLOR RED FOR A RANGE OF CELLS ON ACTIVE OBJECT ***
' ****************************************************************************************************
'Call xLFmtFillColorRed(intTopRow, intBotRow, intLCol, intRCol)
Dim strLeftLetter As String
Dim strRightLetter As String
Dim intRow As Integer
strLeftLetter = ConvColLet(intLCol)
strRightLetter = ConvColLet(intRCol)
For intRow = intTopRow To intBotRow
[blue] goXL.ActiveSheet.Range("" & (strLeftLetter) & (intRow) & ":" & (strRightLetter) & (intRow) & "").Select [/blue]
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Next intRow
End Sub