lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi the code below does not work. Complaining about
I did similar idea with cells and everything was fine. Please see the second code. Thank you so much.
Code:
xsheet.Tab.ColorIndex = i
I did similar idea with cells and everything was fine. Please see the second code. Thank you so much.
Code:
Sub mysheets()
Dim xsheet As Worksheet
Dim i As Integer
i = 0
For Each xsheet In Worksheets
xsheet.Tab.ColorIndex = i
i = i + 1
Next xsheet
End Sub
Code:
Sub myselection3()
Dim xcell As Range
Dim i As Integer
For Each xcell In Selection
xcell.Value = i
xcell.Interior.ColorIndex = i
i = i + 1
Next xcell
End Sub