Copying formatting from one sheet to another, based on cell contents

Ian1976

Board Regular
Joined
Feb 4, 2016
Messages
137
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have a worksheet "Fault List" with a list of fault codes - Column A - 7231, 4563 & 8634 (approx 300 fault codes) these cells are all red, yellow or blue. next to the fault codes is a summary of the fault (Column B)
2340 may be blue
7123 may be red

When I enter a fault code on my main sheet in cell K10 ( for example 2340, which is Blue) there is a lookup which then pulls the fault summary and puts it in cell K11, what I'd like to know is when I enter a fault code on the main worksheet can I get it to "fetch" the colour of the cell from the "Fault List" too?

The below images may help, as I may not have explained myself correctly?

The coloured fault list is on sheet 4, the cell K10 on the second image is the one I manually change, is there a way to make it's cell colour match the one in the fault list, i.e. Blue?

Thanks

1663304252188.png
1663304260084.png
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I'm somewhat clear what you want. But I can't regenerate whole data to explain what needs to be done.

So you upload sample data of all sheets using XL2BB utility (You will get the link in my signatures below)

Then I will copy your sample data and revert with a solution - Quick and efficient way
 
Upvote 0
Example1.xlsx
ABCDEFGHIJKLMNOP
1
27001
37002
47003
57004
67005
77006
87007
97009
107011
117012
127014
137015
147016
157017
167018
177019
187020
197021
207022
217023
227026
237027
247028
257029
267030
277031
287032
297033
307034
317035
327036
337037
347038
357039
367040
377041
387042
397043
407044
417045
427046
437047
447048
457050
467051
477052
487053
497054
507055
517056
527057
Sheet4
 
Upvote 0
Example1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1
2
3
4
5
6
7
8
9
107026
11  
12  
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Sheet2
Cell Formulas
RangeFormula
Q11Q11=IFNA(VLOOKUP(Q10,[160922_Days.xlsm]Sheet4!I2:L360,2,FALSE),"")
W11W11=IFNA(VLOOKUP(W10,[160922_Days.xlsm]Sheet4!I2:L360,2,FALSE),"")
Q12Q12=IFNA(VLOOKUP(Q10,[160922_Days.xlsm]Sheet4!I2:L360,4,FALSE),"")
W12W12=IFNA(VLOOKUP(W10,[160922_Days.xlsm]Sheet4!I2:L360,4,FALSE),"")
Named Ranges
NameRefers ToCells
TMS=[160922_Days.xlsm]Sheet4!$I$2:$I$360Q11:V90
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K10:P10Expression=MATCH(K10:P10,INDIRECT("+Sheet4!$I$2:$I$370"),0)textNO
 
Upvote 0
Sorry,didn't know how to post 2 sheets in the same reply?

So basically when I change the the number in K10 on sheet2 I'd like it to be the same colour as the same number in the list on sheet4!

Thanks
 
Upvote 0
Example1.xlsx
ABCDEFGHIJKLMNOP
1
27001
37002
47003
57004
67005
77006
87007
97009
107011
117012
127014
137015
147016
157017
167018
177019
187020
197021
207022
217023
227026
237027
247028
257029
267030
277031
287032
297033
307034
317035
327036
337037
347038
357039
367040
377041
387042
397043
407044
417045
427046
437047
447048
457050
467051
477052
487053
497054
507055
517056
527057
Sheet4
Understandably, you are not using rules to conditional format on sheet 4

Are there any rules to format these? they can't be random formats...

Also you still haven't got the solution as yet so remove the solution tick so that the experts or onlookers know that solution is yet to be delivered.
 
Upvote 0
There are no rules they are just individually colour as required.

Thanks
 
Upvote 0
There are no rules they are just individually colour as required.

Thanks
Now I see where we got stuck up.

If there can be pattern why a particular number gets that formatting we can do things very swiftly - Just set the rules and use them anywhere we want

Else copying a format and pasting it can be a tedious job and might require VBA code to do that.
 
Upvote 0
Example1.xlsx
ABCDEFGHIJKLMNOP
1
27001
37002
47003
57004
67005
77006
87007
97009
107011
117012
127014
137015
147016
157017
167018
177019
187020
197021
207022
217023
227026
237027
247028
257029
267030
277031
287032
297033
307034
317035
327036
337037
347038
357039
367040
377041
387042
397043
407044
417045
427046
437047
447048
457050
467051
477052
487053
497054
507055
517056
527057
Sheet4
And with 300+ fault code it's difficult to find a pattern... Difficult but achievable and XL2BB does not allow to copy paste that big data...
 
Upvote 0
lol, unfortunately there is no pattern to the colours/numbers, :cry: that's how they came generated!
 
Upvote 0

Forum statistics

Threads
1,215,255
Messages
6,123,896
Members
449,132
Latest member
Rosie14

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