Special conditional formatting; highlight the series

Kishan

Well-known Member
Joined
Mar 15, 2011
Messages
1,648
Office Version
  1. 2010
Platform
  1. Windows
Using Excel 2000</SPAN></SPAN>

Hi,</SPAN></SPAN>

I am looking special conditional formatting; perhaps it would not be possible doing by the formula. Need your help with a VBA solution </SPAN></SPAN>

My series is made of three characters 1, X and 2</SPAN></SPAN>

I want to highlight every series in 2 different colours as shown in the given example below</SPAN></SPAN>

Here is a example of row 6, and will be followed the same method for all the rest rows bellows, Series start with "1" and will end with "2"</SPAN></SPAN>

C6 = X its alone series end, because D6 has "1" so highlight C6 with Green</SPAN></SPAN>
D6 = 1 and E6 = 2 series end, because F6 has "1" so highlight D6:E6 with Red</SPAN></SPAN>
F6:G6 Series with colour Green</SPAN></SPAN>
H6:I6 series with colour Red</SPAN></SPAN>
J6:L6 series with colour Green</SPAN></SPAN>
And last M6:P6 with colour Red </SPAN></SPAN>

Result data example</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQ
1
2
3
4
5P1P2P3P4P5P6P7P8P9P10P11P12P13P14
6X1212XX1121X22
71X2221XX22XX11
81X11XX22XX11XX
91X1221X11X1221
10X1X1X11X111XX1
11XXX1111X1X212X
122X1112XXX11121
13X1XX1111111X11
14211X211X2X222X
15X112X12111111X
161212X21X12X111
172XX1221112111X
18111121112121XX
191212111221211X
20
21
Sheet2


Thank you in advance</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan</SPAN></SPAN>
 
Last edited:

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Re: Need help with a special conditional formatting; highlight the series

Hi, if any formula can tweak this will be the perfect. Please suggest some</SPAN></SPAN>

Thank you
</SPAN></SPAN>

Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Hi, is it possible if I make a table in columns R:Z with numbers to be highlighted columns C:P accordingly numbers of R:Z like the example below </SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1
2
3
4
5P1P2P3P4P5P6P7P8P9P10P11P12P13P14Color1Color2Color3Color4Color5Color6Color7Color8Color9
6X1212XX1121X22122234
71X2221XX22XX115522
81X11XX22XX11XX2624
91X1221X11X122123261
10X1X1X11X111XX1121351
11XXX1111X1X212X35321
122X1112XXX11121114341
13X1XX1111111X111382
14211X211X2X222X14441
15X112X12111111X13127
161212X21X12X11112344
172XX1221112111X5423
18111121112121XX5423
191212111221211X22523
20
21
Sheet2


Thank you</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan </SPAN></SPAN>
 
Last edited:
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Bump
 
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Hi, actually in post#3 I noticed that I had wrong numbers row R16:Z17 which to be filled colours in the column C:P. here is the corrected example table</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1
2
3
4
5P1P2P3P4P5P6P7P8P9P10P11P12P13P14Color1Color2Color3Color4Color5Color6Color7Color8Color9
6X1212XX1121X22122234
71X2221XX22XX115522
81X11XX22XX11XX2624
91X1221X11X122123261
10X1X1X11X111XX1121351
11XXX1111X1X212X35321
122X1112XXX11121114341
13X1XX1111111X111382
14211X211X2X222X14441
15X112X12111111X13127
161212X21X12X1112222213
172XX1221112111X12344
18111121112121XX5423
191212111221211X22523
20
21
Sheet2


Thank you</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan</SPAN></SPAN>
 
Last edited:
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Hi not sure about your logic,
you can use

Range A
For each cell in A
if cell.value =1 then cell.interior. setcolour=2
else if cell.value =2 then cell.interior. setcolour=3

some condition
reset colour number = 1
otherwise keep using colour number 2
 
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Hi not sure about your logic,
you can use

Range A
For each cell in A
if cell.value =1 then cell.interior. setcolour=2
else if cell.value =2 then cell.interior. setcolour=3

some condition
reset colour number = 1
otherwise keep using colour number 2
Hi nikio8, thank you for your response, here is the example for row 6 and will be applied same rules for all rows. </SPAN></SPAN>


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1
2
3
4
5P1P2P3P4P5P6P7P8P9P10P11P12P13P14Color1Color2Color3Color4Color5Color6Color7Color8Color9
6X1212XX1121X22122234
Sheet2


Really I am looking 2 colours conditional formatting. </SPAN></SPAN>

CF formula needs to check the series for "1", "X" and "2"; where "1" is a start of character of the series and "2" is the end of series.</SPAN></SPAN>

If you observe in the C6 = "X" neither "1" before nor "2" is after so "X" stand alone in the series for "X2" colour cell C6 with green.</SPAN></SPAN>

Search for next "1X2" series D6 = "1" and E6 = "2" series over Colour D6:E6 in Red.</SPAN></SPAN>

Search for next "1X2" series F6 = "1" and G6 = "2" series over Colour F6:G6 in Green.</SPAN></SPAN>

Search for next "1X2" series H6 = "X" and I6 = "X" series over Colour H6:I6 in Red.</SPAN></SPAN>

Search for next "1X2" series J6 & K6 = "1" and L6 = "2" series over Colour J6, K6, L6 in Green.</SPAN></SPAN>

Search for next "1X2" series M = "1" N6 = "X" and O6 & P6 = "2" series over Colour M6, N6, O6, P6 in Red.</SPAN></SPAN>

Resume: keep changing the colours when the "1X2" series is completed. </SPAN></SPAN>

This is what I wanted as per post#1.</SPAN></SPAN>

But later I realized might it not work like this so far in the post#5 I added the extra columns R:Z numbers of columns to be coloured to make bit easier, if it could be done directly without R:Z columns will be the fantastic</SPAN></SPAN>


Thank you</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan</SPAN></SPAN>
 
Last edited:
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Bump
 
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Bump
 
Upvote 0
Re: Need help with a special conditional formatting; highlight the series

Hi, 205 views I could imagine this colouring has a high difficulty level. May some one can suggest other way, I mean using some helper columns can be achieved to do this will be also perfect I have no problem to adapt any layout.</SPAN></SPAN>

Thank you
</SPAN></SPAN>

Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,591
Members
449,174
Latest member
chandan4057

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