-
Something like this can be used. In the referenced link, there is an API method but choosing a custom color will fail. ColorIndex is not as reliable as Color.
[VBA]'http://www.mrexcel.com/forum/showthread.php?t=370318
Sub SetTabColor()
Dim r As Range, rc As Long
Set r = Range("h100")
r.Select
rc = r.Interior.Color
With Application.CommandBars("Fill Color")
.Visible = True
.Position = msoBarFloating
.Left = r.Offset(0, 1).Left
.Top = r.Top - r.Top
Do
DoEvents
Loop Until .Visible = False
End With
ActiveSheet.Tab.ColorIndex = r.Interior.ColorIndex
r.Interior.Color = rc
End Sub[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules