Hello everybody,
I would like to change the colors of certain sheets, which meet this condition => If Left(cell, 1) = " " Or Right(cell, 1) = " " Then cell.Interior.Color = 65535
Thanks for listening
I would like to change the colors of certain sheets, which meet this condition => If Left(cell, 1) = " " Or Right(cell, 1) = " " Then cell.Interior.Color = 65535
VBA Code:
Sub Select_All_Cells_with_Data()
Dim sht
Set Rng = ActiveSheet.UsedRange
Rng.Cells(1, 1).Select
For i = 1 To Rng.Rows.Count
For j = 1 To Rng.Columns.Count
If Rng.Cells(i, j) <> "" Then
Union(Selection, Rng.Cells(i, j)).Select
End If
Next j
Next i
'Highlight cells
For Each cell In Selection
If Left(cell, 1) = " " Or Right(cell, 1) = " " Then cell.Interior.Color = 65535
Next cell
For Each sht In ThisWorkbook.Worksheets
sht.Tab.ColorIndex = 6
Next sht
End Sub
Thanks for listening