ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Linking Formats (color) Between Cells in Diff Wsheets (https://www.excelbanter.com/excel-programming/435309-linking-formats-color-between-cells-diff-wsheets.html)

Russ ---------------------ance,Russ

Linking Formats (color) Between Cells in Diff Wsheets
 
I've seen (my) question answered in bits and pieces (or the silver bullet has
eluded me ;) but this is the precise problem I'm trying to solve:

I want sheet 1 to have a myriad of different colored cells (think
tracking/scheduling)
I want the ability to change the color of any one, or range of cells in
sheet 1 and automatically have corresponding cells in sheet 2 change to same.

I've seen partial answers involving conditional formatting and/or VB...my
dream answer would be without a macro, but if necessary, can anyone point me
to a complete example? (I suck with macros ;)

Thanks much in advance,I've seen (my) question answered in bits and pieces
(or the silver bullet has eluded me ;) but this is the precise problem I'm
trying to solve:

I want sheet 1 to have a myriad of different colored cells (think
tracking/scheduling)
I want the ability to change the color of any one, or range of cells in
sheet 1 and automatically have corresponding cells in sheet 2 change to same.

I've seen partial answers involving conditional formatting and/or VB...my
dream answer would be without a macro, but if necessary, can anyone point me
to a complete example? (I suck with macros ;)

Thanks much in advance

Tim Williams[_4_]

Linking Formats (color) Between Cells in Diff Wsheets
 
How large are the ranges you need to match up ? That might influence
the most appropriate solution.

As far as I know this can't be done with conditional formatting:
you're going to have to use a macro.

Sub MatchInteriorColors()
Dim c As Range
Application.ScreenUpdating = False
For Each c In Sheet1.Range("A1:H100") 'adjust to suit
Sheet2.Cells(c.Row, c.Column).Interior.ColorIndex = _
c.Interior.ColorIndex
Next c
Application.ScreenUpdating = True
End Sub

You could trigger this on sheet activate for sheet2

Tim

On Oct 22, 2:25*pm, Russ ---------------------ance,Russ
wrote:
I've seen (my) question answered in bits and pieces (or the silver bullet has
eluded me ;) *but this is the precise problem I'm trying to solve:

I want sheet 1 to have a myriad of different colored cells (think
tracking/scheduling)
I want the ability to change the color of any one, or range of cells in
sheet 1 and automatically have corresponding cells in sheet 2 change to same.

I've seen partial answers involving conditional formatting and/or VB...my
dream answer would be without a macro, but if necessary, can anyone point me
to a complete example? *(I suck with macros ;)


Patrick Molloy[_2_]

Linking Formats (color) Between Cells in Diff Wsheets
 
an alternative way would be to use Format/Styles
create a style with whatever color you want, then apply it to cells on any
of yuor sheets sheets Now if you edit the style and change the color, all
cells formatted with that style will automatically reflect the change

changign color in code then is simplistic...

Option Explicit
Sub test()
ChangeStyleColor 32
ChangeStyleColor 34
End Sub


Sub ChangeStyleColor(colorchoice As Long)
ActiveWorkbook.Styles("Patrick1").Interior.ColorIn dex = colorchoice
End Sub

create a style, in my case I called it Patrick1
select cells and set to this style
F8 (step) through the test code and see the color change




"Russ
---------------------ance,Russ" wrote:

I've seen (my) question answered in bits and pieces (or the silver bullet has
eluded me ;) but this is the precise problem I'm trying to solve:

I want sheet 1 to have a myriad of different colored cells (think
tracking/scheduling)
I want the ability to change the color of any one, or range of cells in
sheet 1 and automatically have corresponding cells in sheet 2 change to same.

I've seen partial answers involving conditional formatting and/or VB...my
dream answer would be without a macro, but if necessary, can anyone point me
to a complete example? (I suck with macros ;)

Thanks much in advance,I've seen (my) question answered in bits and pieces
(or the silver bullet has eluded me ;) but this is the precise problem I'm
trying to solve:

I want sheet 1 to have a myriad of different colored cells (think
tracking/scheduling)
I want the ability to change the color of any one, or range of cells in
sheet 1 and automatically have corresponding cells in sheet 2 change to same.

I've seen partial answers involving conditional formatting and/or VB...my
dream answer would be without a macro, but if necessary, can anyone point me
to a complete example? (I suck with macros ;)

Thanks much in advance



All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com