Summary sheet colour

mattless1

Board Regular
Joined
Apr 1, 2011
Messages
102
Hi All,

I have a summary sheet with all my suppliers on it.
is there a way I can colour the supplier names in the summary sheet with colour of their tabs.

thanks in advance.
 
Did you copy the entire code, or did you miss the last line?
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
This is what I copied, the first line is yellow

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sub ColorSupplier()
Dim supplier As Range, ws As Worksheet
For Each supplier In Sheets("Summary").Range("A4", Sheets("Summary").Range("A" & Rows.Count).End(xlUp))
For Each ws In ActiveWorkbook.Sheets
If UCase(ws.Name) = UCase(supplier) Then
supplier.Interior.Color = ws.Tab.Color
Exit For
End If
Next ws
Next supplier
End Sub
 
Upvote 0
Get rid of the first line and just use the code as supplied
 
Upvote 0
Hi Fluff,

yes that works perfect.

thank you and Yongle for helping me out. :) I would of never done it with out you.

Kind Regards,
Larry.
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,026
Members
449,414
Latest member
sameri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top