Excel VBA/Formula to perform operation in a cell based on cell Colour

erbhaskar95

New Member
Joined
Apr 30, 2021
Messages
14
Office Version
  1. 2016
Platform
  1. Windows
Hello there,

Here, we have a Red and White Coloured cells in "Remarks" Column. The white coloured cells are fine and need not to be worried about.

As shown, there is a continued red coloured cells upto S.N 5 Row starting from S.N No 2 Row. So, I want to copy its corresponding "Ending" Column Value one cell above the starting point of Red Coloured Cell in "Remarks" Column.
Similarly, I want to put "Ending" Column value from S.N 8 Row to S.N No 7 Row (as there is only 1 Red coloured cell in a stretch)
Similarly, I want to put "Ending" Column value from S.N 22 Row to S.N No 20 Row (as there is 2 Red coloured cell in a stretch)
And so on depending on how may red coloured cells are there in a stretch in my entire file.

Is it possible to do this using VBA or any method?

sfsf.xlsm
AHAIAJAK
1S.NStartingEndingCondition
21178265
3230636841
43343412-25
54388454-24
65415482-39
76732802250
8710331095231
9810861151-9
10913131418162
1110407541352657
12114233429498
131247004759406
141349164977157
15145056511179
161552845347173
17165408546861
181755955651127
191860846141433
201962716334130
212064946580160
222165596616-21
23226648673032
24236804687174
252470647135193
262576867745551
27267794785949
282780378093178
29288103818210
30298273834291
313087968859454
323188278897-32
33328915904018
343393159383275
Chainage
Cell Formulas
RangeFormula
AK3:AK34AK3=AI3-AJ2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AK3:AK101Expression=AK3<50textNO
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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