I have NFL stats, in which I'm logging into a table in order to create conditional formatted heat-maps.
Starting in column E and ending in column P is my data, but I need it to start at a2 and go to the last row of that column, and then do the same for every column so the conditions don't overlap and create one large heat-map. I just want a heatmap for every separate column so I can analyze that way. (NOT ALL COLUMNS CONTAIN NUMBERS, AND THEY'RE SPREAD OUT, SO CONDITIONAL FORMATTING SHOULDN'T PICK UP TEXT COLUMNS ANYWAYS)
How would I go about looping the columns without explicitly referencing them? My status for one position won't contain the same amount of columns as another one.
I need this to be as dynamic as possible. Also, can anyone help me clean up the conditional formatting pieces? I just copied over the macro recorded code for that since I don't know how to compile it myself.
I was thinking something like this:
Dim Overall_Stats As Workbook
Dim RB_stats As Worksheet
Set RB_stats = Overall_Stats.Sheets(RB)
LastRow = Range("A" & Rows.Count).End(xlUp).Row
with RB_stats
.Range("A2:A" & LastRow)
.FormatConditions.AddColorScale ColorScaleType:=3
.FormatConditions(.FormatConditions.Count).SetFirstPriority
.FormatConditions(1).ColorScaleCriteria(1).Type = _
xlConditionValueLowestValue
With .FormatConditions(1).ColorScaleCriteria (1).FormatColor
.Color = 8109667
.TintAndShade = 0
End With
.FormatConditions(1).ColorScaleCriteria(2).Type = _
xlConditionValuePercentile
.FormatConditions(1).ColorScaleCriteria(2).Value = 50
With .FormatConditions(1).ColorScaleCriteria(2).FormatColor
.Color = 8711167
.TintAndShade = 0
End With
.FormatConditions(1).ColorScaleCriteria(3).Type = _
xlConditionValueHighestValue
With .FormatConditions(1).ColorScaleCriteria(3).FormatColor
.Color = 7039480
.TintAndShade = 0
End With
End With
For i = 1 to 100
Columns(i).Select
next I