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
 
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...
Yes I was hoping that the solution would allow me to just alter it to suit the 300 other numbers!
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
lol, unfortunately there is no pattern to the colours/numbers, :cry: that's how they came generated!
You know we can populate the rule(s) manually based on values and Using AND function in Conditional formatting. Time taking but can be done if that is extremely important.

VBA I'm a novice so I don't want to give you a wrong code - That's why I told you to keep thread unresolved.
 
Upvote 0
You know we can populate the rule(s) manually based on values and Using AND function in Conditional formatting. Time taking but can be done if that is extremely important.

VBA I'm a novice so I don't want to give you a wrong code - That's why I told you to keep thread unresolved.
It would be very useful to me to "have" it as it's a visual aid to the severity of the fault code! :)
 
Upvote 0
It would be very useful to me to "have" it as it's a visual aid to the severity of the fault code! :)
Luckily I'm free right now

You paste all 300+ rows here using XL2BB - Probably it allows 50 rows at a time

You copy only that column as mini sheet and paste here in 6+ attempts - I see if I can help you in some way - Would try not commit - Although I'm a person if I get into something try to resolve it
 
Upvote 0
Luckily I'm free right now

You paste all 300+ rows here using XL2BB - Probably it allows 50 rows at a time

You copy only that column as mini sheet and paste here in 6+ attempts - I see if I can help you in some way - Would try not commit - Although I'm a person if I get into something try to resolve it
its let me do them all?

160922_Days.xlsm
I
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
537058
547059
557061
567062
577063
587064
597066
607067
617068
627069
637070
647071
657072
667073
677074
687076
697077
707078
717079
727080
737081
747082
757083
767084
777085
787086
797087
807088
817089
827090
837091
847092
857093
867094
877095
887096
897097
907098
917099
927100
937101
947102
957103
967104
977105
987106
997107
1007108
1017109
1027110
1037111
1047112
1057113
1067114
1077115
1087116
1097117
1107118
1117119
1127120
1137121
1147122
1157123
1167124
1177125
1187126
1197127
1207128
1217129
1227130
1237131
1247132
1257133
1267134
1277135
1287136
1297137
1307138
1317139
1327140
1337141
1347144
1357145
1367146
1377147
1387148
1397150
1407152
1417153
1427154
1437155
1447156
1457157
1467159
1477160
1487161
1497162
1507163
1517164
1527165
1537166
1547167
1557168
1567169
1577170
1587171
1597172
1607173
1617174
1627175
1637176
1647177
1657178
1667179
1677180
1687181
1697182
1707183
1717184
1727185
1737186
1747187
1757188
1767189
1777190
1787191
1797192
1807193
1817194
1827196
1837197
1847198
1857199
1867200
1877201
1887202
1897203
1907205
1917206
1927207
1937208
1947209
1957210
1967211
1977212
1987213
1997214
2007215
2017217
2027218
2037219
2047220
2057221
2067222
2077223
2087224
2097225
2107226
2117227
2127228
2137229
2147230
2157231
2167238
2177239
2187240
2197241
2207242
2217243
2227244
2237245
2247246
2257249
2267252
2277253
2287254
2297255
2307256
2317257
2327258
2337259
2347260
2357261
2367262
2377263
2387264
2397265
2407266
2417267
2427268
2437269
2447270
2457271
2467272
2477273
2487274
2497275
2507276
2517277
2527278
2537279
2547280
2557284
2567285
2577286
2587287
2597288
2607289
2617291
2627292
2637293
2647294
2657295
2667296
2677297
2687298
2697299
2707300
2717301
2727302
2737303
2747304
2757305
2767306
2777307
2787308
2797309
2807312
2817323
2827330
2837331
2847332
2857333
2867334
2877335
2887337
2897338
2907339
2917340
2927341
2937342
2947343
2957344
2967345
2977346
2987347
2997348
3007349
3017350
3027351
3037352
3047353
3057354
3067355
3077356
3087357
3097358
3107361
3117362
3127363
3137364
3147365
3157372
3167373
3177380
3187390
3197391
3207392
3217393
3227394
3237395
3247396
3257397
3267398
3277399
3287400
3297401
3307402
3317403
3327404
3337405
3347406
3357407
3367420
3377421
3387422
3397423
3407424
3417425
3427426
3437427
3447428
3457429
3467430
3477431
3487432
3497433
3507434
3517435
3527436
3537437
3547438
3557439
3567440
3577441
3587501
3597502
3607503
3617508
3627509
3637510
3647511
3657374
3667375
3677376
3687377
3697378
3707379
Sheet4
 
Upvote 0
Here underneath I'm giving you an idea through 3 XL2BB attachments (in this thread only - Just copy from utility and paste one after another in thread) how you can achieve the results - As you said it was important for you!

In cell O2 I have tested the rules we have created. And in Cell N3, I have mentioned the way to copy all the conditional formatting from one sheet to another in one single step. See the attached screenshot too. And it's done.

I have given you the idea, now you have to the efforts for yourselves.

All Records.xlsb
IJ
1OriginalTested
270027002
370037003
470047004
570057005
670067006
770077007
870157015
970167016
1070177017
1170197019
1270297029
1370307030
1470317031
1570347034
1670357035
1770387038
1870397039
1970407040
2070417041
2170427042
2270437043
2370477047
2470487048
2570507050
2670517051
2770527052
2870537053
2970547054
3070557055
3170567056
3270587058
3370597059
3470617061
3570627062
3670637063
3770647064
3870667066
3970677067
4070687068
4170697069
4270707070
4370737073
4470747074
4570767076
4670797079
4770807080
4870817081
4970827082
5070837083
5170847084
5270857085
5370867086
5470877087
5570887088
5670937093
5770947094
5870957095
5970967096
6070977097
6170987098
6270997099
6371007100
6471057105
6571067106
6671077107
6771087108
6871097109
6971107110
7071117111
7171127112
7271177117
7371187118
7471197119
7571207120
7671217121
7771227122
7871237123
7971247124
8071297129
8171307130
8271317131
8371327132
8471357135
8571367136
8671377137
8771387138
8871417141
8971457145
9071467146
9171477147
9271487148
9371527152
9471537153
9571547154
9671557155
9771567156
9871577157
9971697169
10071707170
10171717171
10271727172
10371757175
10471847184
10571857185
10671867186
10771887188
10871897189
10971907190
11071967196
11171977197
11271997199
11372037203
11472057205
11572067206
11672127212
11772137213
11872147214
11972157215
12072177217
12172187218
12272197219
12372207220
12472237223
12572247224
12672257225
12772267226
12872297229
12972307230
13072317231
13172387238
13272397239
13372407240
13472417241
13572427242
13672437243
13772447244
13872457245
13972887288
14072897289
14173337333
14273347334
14373357335
14473457345
14573477347
14673487348
14773497349
14873547354
14973557355
15073567356
15173577357
15273617361
15373627362
15473637363
15573647364
15673727372
15773737373
15873807380
15973907390
16073917391
16173927392
16273937393
16374207420
16475027502
16575037503
16673767376
16773777377
16873787378
16970097009
17070127012
17170207020
17270217021
17370287028
17470367036
17570377037
17670447044
17770467046
17870897089
17970907090
18070917091
18170927092
18271017101
18371027102
18471037103
18571047104
18671137113
18771147114
18871157115
18971167116
19071257125
19171267126
19271277127
19371287128
19471337133
19571347134
19671397139
19771407140
19871507150
19971657165
20071667166
20171677167
20271687168
20371737173
20471747174
20571767176
20671777177
20771787178
20871797179
20971807180
21071817181
21171827182
21271837183
21371877187
21471987198
21572007200
21672017201
21772027202
21872077207
21972087208
22072097209
22172107210
22272117211
22372217221
22472227222
22572277227
22672287228
22772587258
22872597259
22972607260
23072637263
23172647264
23272657265
23372687268
23472697269
23572707270
23672737273
23772747274
23872757275
23972767276
24072797279
24172807280
24272847284
24372857285
24473377337
24573387338
24673397339
24773407340
24873417341
24973587358
25074017401
25174027402
25274037403
25374047404
25474057405
25574067406
25674077407
25774217421
25874227422
25974237423
26074247424
26175017501
26275087508
26375097509
26475107510
26575117511
26673747374
26773757375
26873797379
26970017001
27070117011
27170147014
27270187018
27370227022
27470237023
27570267026
27670277027
27770327032
27870337033
27970457045
28070577057
28170717071
28270727072
28370777077
28470787078
28571447144
28671597159
28771607160
28871617161
28971627162
29071637163
29171647164
29271917191
29371927192
29471937193
29571947194
29672467246
29772497249
29872527252
29972537253
30072547254
30172557255
30272567256
30372577257
30472617261
30572627262
30672667266
30772677267
30872717271
30972727272
31072777277
31172787278
31272867286
31372877287
31472917291
31572927292
31672937293
31772947294
31872957295
31972967296
32072977297
32172987298
32272997299
32373007300
32473017301
32573027302
32673037303
32773047304
32873057305
32973067306
33073077307
33173087308
33273097309
33373127312
33473237323
33573307330
33673317331
33773327332
33873427342
33973437343
34073447344
34173467346
34273507350
34373517351
34473527352
34573537353
34673657365
34773947394
34873957395
34973967396
35073977397
35173987398
35273997399
35374007400
35474257425
35574267426
35674277427
35774287428
35874297429
35974307430
36074317431
36174327432
36274337433
36374347434
36474357435
36574367436
36674377437
36774387438
36874397439
36974407440
37074417441
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J2:J370Expression=K2<>""textNO


Its not allowing to copy the whole columns since it contains formula or formatting so copying a small part for your understanding -

All Records.xlsb
K
1Test
2 
3 
4 
5 
6 
7 
88
9 
10 
112
1210
13 
14 
153
16 
173
18 
19 
20 
21 
22 
234
Sheet3
Cell Formulas
RangeFormula
K2:K23K2=IFERROR(IF([@Tested]-OFFSET([@Tested],-1,0)>1,[@Tested]-OFFSET([@Tested],-1,0),""),"")


Its not allowing to copy the whole columns since it contains formula or formatting so copying a small part for your understanding -

All Records.xlsb
L
1Formatted
27002
37003
47004
57005
67006
77007
87015
97016
107017
117019
127029
137030
147031
157034
167035
177038
187039
197040
207041
217042
227043
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
L2:L370Cell Valuebetween 7176 and 7183textNO
L2:L370Cell Valuebetween 7159 and 7164textNO
L2:L370Cell Valuebetween 7079 and 7088textNO
L2:L370Cell Valuebetween 7066 and 7070textNO
L2:L370Cell Valuebetween 7061 and 7064textNO
L2:L370Cell Valuebetween 7050 and 7056textNO
L2:L370Cell Valuebetween 7038 and 7043textNO
L2:L370Cell Valuebetween 7029 and 7031textNO
L2:L370Cell Valuebetween 7002 and 7007textNO


Its not allowing to copy the whole columns since it contains formula or formatting so copying a small part for your understanding -

All Records.xlsb
NO
1
2Test the rule7177
3Simply copy cell L2 and paste Formatting using paste special in Cell O2 And its done!
4
5
6
7
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
O2Cell Valuebetween 7176 and 7183textNO
O2Cell Valuebetween 7159 and 7164textNO
O2Cell Valuebetween 7079 and 7088textNO
O2Cell Valuebetween 7066 and 7070textNO
O2Cell Valuebetween 7061 and 7064textNO
O2Cell Valuebetween 7050 and 7056textNO
O2Cell Valuebetween 7038 and 7043textNO
O2Cell Valuebetween 7029 and 7031textNO
O2Cell Valuebetween 7002 and 7007textNO
 

Attachments

  • Screenshot 2022-09-16 at 21.09.02.png
    Screenshot 2022-09-16 at 21.09.02.png
    163.7 KB · Views: 2
Upvote 0
Solution

Forum statistics

Threads
1,215,232
Messages
6,123,768
Members
449,122
Latest member
sampak88

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