Hi, I am new to this and macros.
Been messing around a bit and achieved quite a lot already without help, but now I am stuck.
I know I am doing things the long way but that's because of my limited understanding of the code,
what I am trying to do is every time I click the worksheet the macro must run and check a cell value and if the cell value is emtpy it must highlight the entire row(no probs can do this),
but I have to do this for each row, 300 hundred of them and I am using the same code multiple times so I get the error "compile error: procedure to large".
I do not know how to split the code so that its smaller but then both sets of code run when the sheet is activated and I do not know how to make the code itself shorter so there is no need to split it.
Any help u can offer will be greatly appreciated.
This is the code.
Private Sub Worksheet_Activate()
If Sheets("Players").Range("K5") = "" Then
Sheets("Players").Range("B5:J5").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
If Sheets("Players").Range("K6") = "" Then
Sheets("Players").Range("B6:J6").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
all the way through to
If Sheets("Players").Range("K300") = "" Then
Sheets("Players").Range("B300:J300").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
End Sub
Don't laugh, took ages and thought I was very cleaver to figure out the code lol. Just a pity it to long to work.
Bookmarks