Hi all,
I wonder if there's a way to write the code for filling entire row based on cell value (TRUE) which is stated in another worksheet. I'm working on highliting rows with names of people who belong to different time shifts. In "Sheet1" I created a list of people who are working and next to them I created set of check boxes to state on which shift they're working (they have statement connection with specific cells). Now I Try to create macro which would fill entire row of this person in another worksheet but nothing works so far. The best I could think of is:
Sub ColorRows()
Worksheets("Sheet 2").Select
If Worksheets("Sheet 1").Cells(H4) = True Then
Cells(4).EntireRow.Interior.ColorIndex = 255
Elseif Worksheets("Sheet 1").Cells(J4) = True Then
Cells(4).EntireRow.Interior.ColorIndex = 255
Elseif Worksheets("Sheet 1").Cells(L4) = True Then
Cells(4).EntireRow.Interior.ColorIndex = 255
Endif
End Sub
I wonder if there's a way to write the code for filling entire row based on cell value (TRUE) which is stated in another worksheet. I'm working on highliting rows with names of people who belong to different time shifts. In "Sheet1" I created a list of people who are working and next to them I created set of check boxes to state on which shift they're working (they have statement connection with specific cells). Now I Try to create macro which would fill entire row of this person in another worksheet but nothing works so far. The best I could think of is:
Sub ColorRows()
Worksheets("Sheet 2").Select
If Worksheets("Sheet 1").Cells(H4) = True Then
Cells(4).EntireRow.Interior.ColorIndex = 255
Elseif Worksheets("Sheet 1").Cells(J4) = True Then
Cells(4).EntireRow.Interior.ColorIndex = 255
Elseif Worksheets("Sheet 1").Cells(L4) = True Then
Cells(4).EntireRow.Interior.ColorIndex = 255
Endif
End Sub