I am currently working with a file that contains dates in chronological order in column A and column B contains a dollar value. I would like to highlight the current cell in a color where I put the cursor and then highlight every 7th cell(week) back. For example, if I put my cursor on cell A11, I would like that cell to highlight yellow and then highlight every 7th cell back in the same color. I am looking at a weekly trends. I have the code, which highlights the entire row where I put the cursor but cannot get it to just highlight the cell and every 7th cell back. here is the code which highlights the entire row where the cursor is.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
' Clear the color of all the cells
Target.Parent.Cells.Interior.ColorIndex = 0
With Target
' Highlight the entire row and column that contain the active cell
.EntireRow.Interior.ColorIndex = 10
End With
Application.ScreenUpdating = True
End Sub
Bookmarks