PC Review


Reply
Thread Tools Rate Thread

Changing tab color continued

 
 
Amie
Guest
Posts: n/a
 
      23rd Jun 2008
This is great thank you. Another question what if I want to say:

If any of the cells in the worksheet are colored yellow then color
the
tab yellow? Here is the code that I have written but this is only
good for column 1


Private Sub Worksheet_SelectionChange(ByVal Target As Range)


Dim iRow As Integer
iRow = 1


Do Until iRow = 300
If Cells(iRow, 1).Interior.Color = 65535 Then
With ActiveSheet.Tab
.Color = 65535
End With
Exit Do
Else
With ActiveSheet.Tab
.Color = 0
End With
End If
iRow = iRow + 1


Loop


End Sub


 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      23rd Jun 2008
You should STAY in the ORIGINAL thread. Try this idea.

Sub cc()
For Each c In ActiveSheet.UsedRange
If c.Interior.ColorIndex > 0 Then MsgBox c.Row
Next c
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Amie" <(E-Mail Removed)> wrote in message
news:03227cff-7b52-48c2-838c-(E-Mail Removed)...
> This is great thank you. Another question what if I want to say:
>
> If any of the cells in the worksheet are colored yellow then color
> the
> tab yellow? Here is the code that I have written but this is only
> good for column 1
>
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>
>
> Dim iRow As Integer
> iRow = 1
>
>
> Do Until iRow = 300
> If Cells(iRow, 1).Interior.Color = 65535 Then
> With ActiveSheet.Tab
> .Color = 65535
> End With
> Exit Do
> Else
> With ActiveSheet.Tab
> .Color = 0
> End With
> End If
> iRow = iRow + 1
>
>
> Loop
>
>
> End Sub
>
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing text color and textbox color on Access Report Cindy Microsoft Access Reports 0 1st Dec 2010 05:15 PM
Macro To Change Cell Color (Continued) =?Utf-8?B?Y2FybA==?= Microsoft Excel Worksheet Functions 0 15th Mar 2006 03:10 PM
Changing subform (continued) =?Utf-8?B?QmxhY2tLbmlnaHQ=?= Microsoft Access Forms 0 1st Nov 2005 04:12 PM
changing column names continued =?Utf-8?B?S0lN?= Microsoft Access Queries 4 11th Mar 2005 09:43 PM
Changing Application color to follow Change of System Color Toni Microsoft Dot NET Framework Forms 2 11th May 2004 10:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 AM.