Im looking for a function/macro that finds the next red cell in column A on my worksheet. Basically what I wanna do is Loop through Column A and everytime I find an empty cell, jump down to the next red cell and continue the loop there. All I need is the row# of the next red cell in order to do thuis. What I have working so far is this:
'Loop through column A from top down starting in row 6 and create Chart for each row
For rownumber = 6 To LastRow Step 1
'If Cell is filled
If TPsheet.Cells(rownumber, 1) <> "" Then
'Create Chart
Call CreateChart()
Else
rownumber = rownumber + 2 (This is the problem area, just going down 2 rows sadly doesnt work as sometimes there are 3/4/5 consecutive empty rows, need to set this to rownumber of next red cell)
End If
Next rownumber
The whole table looks like this:
And the amount of empty rows between the different red tables sections can vary, which is why just going down a certain amount of rows when it finds an empty one (my current approach) doesnt work.
For findind a red cell I successfully use this in antoher macro:
Do Until i = 1000
If TPsheet.Range("A" & i).Interior.Color = RGB(255, 0, 0) Then
'...
End If
i = i + 1
Loop
TLDR: Need the rownumber of the next red cell in column a while looping through the column when a cell is empty in order to jump to the next red table header