Home

Color-scale formatting dependent on each individual row in pivot table every three rows

%3CLINGO-SUB%20id%3D%22lingo-sub-755022%22%20slang%3D%22en-US%22%3EColor-scale%20formatting%20dependent%20on%20each%20individual%20row%20in%20pivot%20table%20every%20three%20rows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755022%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20I%20have%20several%20problems%20I%20am%20running%20into-%20two%20questions%20in%20this%20discussion.%20The%20first%20one%20revolves%20around%20a%20pivot%20table%20I%20have%20which%20shows%20each%20individual%20item%20in%20our%20inventory%2C%20its%20description%2C%20and%20the%20three%20key%20data%20points%20for%20each%20(picture%20included%20below)%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123298i63D197D12747591F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22excel%20help%203.png%22%20title%3D%22excel%20help%203.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAs%20you%20can%20see%20above%20I%20have%20a%20conditional%20format%20rule%20for%20a%20color%20scale%20that%20I%20wish%20to%20use%20to%20format%20the%20Supplier%20Network%20DOH%20key%20figure%20spanning%20across%20the%20six%20dates%20for%20each%20individual%20item%20like%20so%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123297i9C5DCD02B1782A91%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22excel%20help%204.png%22%20title%3D%22excel%20help%204.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHowever%2C%20I%20want%20to%20find%20a%20way%20to%20automate%20this%20process%20so%20I%20don't%20have%20to%20go%20through%20each%20individual%20row%20and%20use%20format%20painter%20with%20the%201000%2B%20rows%20that%20I%20have%20to%20format.%20Important%20note%20to%20make%20as%20well%20as%20that%20whether%20I%20filter%20the%20pivot%20table%20to%20just%20Supplier%20Inventory%20DOH%2C%20or%20have%20all%20three%20key%20figures%20present%2C%20the%20conditional%20formatting%20cannot%20just%20be%20dragged%20and%20dropped%20as%20a%20blanket%20across%20all%20of%20the%20data-%20as%20each%20unique%20row%20of%20Supplier%20Inventory%20DOH%20(every%20three%20rows%20or%20so%20with%20the%20three%20figures%20present)%20only%20needs%20to%20be%20formatted-none%20of%20the%20other%20rows%20do.%20I%20found%20a%20similar%20related%20discussions%20referencing%20this%20article%3A%20%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F51991016%2Fexcel-conditional-colour-scale-for-multiple-rows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F51991016%2Fexcel-conditional-colour-scale-for-multiple-rows%3C%2FA%3E%2C%26nbsp%3Band%20I%20tired%20inputting%20this%20code%3A%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22kwd%22%3EOption%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20Explicit%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3ESub%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20ApplyConditionalFormatting%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E()%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EDim%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20ws%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3EAs%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20Worksheet%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3ESet%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20ws%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20ThisWorkbook%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3ESheets%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22str%22%3E%22Sheet1%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22com%22%3E'%20change%20to%20your%20sheet%20here%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EDim%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rw%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3EAs%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3ELong%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EDim%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rng%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3EAs%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20Range%0A%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3EFor%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rw%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E3%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3ETo%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E8%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22com%22%3E'%20change%20to%20your%20respective%20rows%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20ws%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3ESet%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rng%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3ERange%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3ECells%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Erw%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22E%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3ECells%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3Erw%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22K%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E))%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22com%22%3E'%20change%20to%20your%20respective%20columns%3C%2FSPAN%3E%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rng%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EFormatConditions%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EAddColorScale%20ColorScaleType%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3A%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E3%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EFormatConditions%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EFormatConditions%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3ECount%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E).%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3ESetFirstPriority%20%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22com%22%3E'%20now%20its%20index%20is%201%2C%20in%20case%20there%20already%20was%20cond%20formatting%20applied%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rng%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EFormatConditions%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E1%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EColorScaleCriteria%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E1%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EType%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20xlConditionValueNumber%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EValue%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E0%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EFormatColor%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EColor%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E7039480%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EColorScaleCriteria%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E2%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EType%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20xlConditionValueFormula%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EValue%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22%3D'%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20ws%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EName%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22'!%24D%24%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rw%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22*3%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22com%22%3E'%20References%20column%20D%2C%20change%20as%20needed%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EFormatColor%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EColor%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E8711167%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EColorScaleCriteria%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22lit%22%3E3%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E)%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EType%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20xlConditionValueFormula%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EValue%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22%3D'%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20ws%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EName%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22'!%24D%24%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rw%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%26amp%3B%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22str%22%3E%22*5%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22com%22%3E'%20References%20column%20D%2C%20change%20as%20needed%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EFormatColor%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3EColor%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22lit%22%3E8109667%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3EWith%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22kwd%22%3ENext%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E%20rw%3C%2FSPAN%3E%3CSPAN%20class%3D%22kwd%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kwd%22%3ESub%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3EThis%20code%20in%20theory%20would%20just%20be%20a%20blanket%20format%20of%20all%20of%20the%20data%20in%20columns%20B-G%2C%20however%20I%20hoped%20that%20if%20it%20was%20able%20to%20automate%20the%20process%20in%20general%20it%20would%20be%20a%20start.%20So%20I%20changed%20the%20text%20to%20fit%20my%20needs%20(essentially%20the%20same%20macro)%20and%20changed%20the%20formatting%20rules%20to%20format%20based%20on%20numbers%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20983px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123303iED03B5F3A9BD00C4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22excel%20help%206.png%22%20title%3D%22excel%20help%206.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EWhen%20I%20try%20to%20run%20the%20program%20nothing%20happens-%20and%20I%20am%20wondering%20if%20a%20piece%20of%20the%20code%20is%20incorrect.%20Additionally%2C%20what%20code%20would%20be%20required%20to%20format%20every%20three%20rows%20(with%20all%20three%20key%20figures%20present)%2C%20and%20would%20this%20be%20the%20best%20way%20to%20automate%20this%20process%20in%20general%3F%3C%2FP%3E%3CP%3ESecond%20question%3A%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20this%20formatting%20is%20complete%2C%20I%20wish%20to%20copy%20the%20formatted%20colors%20in%20the%20six%20columns%20of%20the%20rows%20associated%20with%20Supplier%20Network%20DOH%2C%20and%20copy%20those%20colors%20without%20the%20rules%20or%20the%20values%20to%20the%20six%20Total%20Inventory%20cells%20below%20for%20each%20item.%20The%20purpose%20of%20this%20to%20be%20able%20to%20show%20with%20the%20use%20of%20conditional%20formatting%20Days%20on%20Hand%20risk-%20through%20color%20layered%20over%20the%20total%20inventory.%20I%20found%20a%20related%20article%20discussion%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F18548156%2Fhow-to-copy-the-conditional-formatting-without-copying-the-rules-from-a-conditio%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F18548156%2Fhow-to-copy-the-conditional-formatting-without-copying-the-rules-from-a-conditio%3C%2FA%3E%2C%20however%20copy%20and%20pasting%20just%20the%20color%20themselves%20did%20not%20work%20on%20my%20Windows%2010%20excel%20version.%20Is%20there%20a%20way%20to%20do%20this%20process%20as%20well%3F%3C%2FP%3E%3CP%3ESorry%20for%20the%20long%20questions-%20but%20I%20would%20appreciate%20any%20help%20I%20can%20get.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-755022%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-755059%22%20slang%3D%22en-US%22%3ERe%3A%20Color-scale%20formatting%20dependent%20on%20each%20individual%20row%20in%20pivot%20table%20every%20three%20rows%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-755059%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F376448%22%20target%3D%22_blank%22%3E%40adisera%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20was%20the%20code-%20I%20didn't%20realize%20it%20came%20out%20weird%20in%20the%20text%20box.%3C%2FP%3E%3C%2FLINGO-BODY%3E
adisera
New Contributor

Hi there,

      I have several problems I am running into- two questions in this discussion. The first one revolves around a pivot table I have which shows each individual item in our inventory, its description, and the three key data points for each (picture included below):excel help 3.png

As you can see above I have a conditional format rule for a color scale that I wish to use to format the Supplier Network DOH key figure spanning across the six dates for each individual item like so:excel help 4.png

However, I want to find a way to automate this process so I don't have to go through each individual row and use format painter with the 1000+ rows that I have to format. Important note to make as well as that whether I filter the pivot table to just Supplier Inventory DOH, or have all three key figures present, the conditional formatting cannot just be dragged and dropped as a blanket across all of the data- as each unique row of Supplier Inventory DOH (every three rows or so with the three figures present) only needs to be formatted-none of the other rows do. I found a similar related discussions referencing this article: https://stackoverflow.com/questions/51991016/excel-conditional-colour-scale-for-multiple-rows, and I tired inputting this code:

Option ExplicitSub ApplyConditionalFormatting()
    Dim ws As Worksheet: Set ws = ThisWorkbook.Sheets("Sheet1") ' change to your sheet here
    Dim rw As Long
    Dim rng As Range

    For rw = 3 To 8 ' change to your respective rows
        With ws
            Set rng = .Range(.Cells(rw, "E"), .Cells(rw, "K")) ' change to your respective columns

            With rng
                .FormatConditions.AddColorScale ColorScaleType:=3
                .FormatConditions(.FormatConditions.Count).SetFirstPriority  ' now its index is 1, in case there already was cond formatting applied
            End With

            With rng.FormatConditions(1)
                With .ColorScaleCriteria(1)
                    .Type = xlConditionValueNumber
                    .Value = 0
                    .FormatColor.Color = 7039480
                End With

                With .ColorScaleCriteria(2)
                    .Type = xlConditionValueFormula
                    .Value = "='" & ws.Name & "'!$D$" & rw & "*3" ' References column D, change as needed
                    .FormatColor.Color = 8711167
                End With

                With .ColorScaleCriteria(3)
                    .Type = xlConditionValueFormula
                    .Value = "='" & ws.Name & "'!$D$" & rw & "*5" ' References column D, change as needed
                    .FormatColor.Color = 8109667
                End With
            End With
        End With
    Next rwEnd Sub

This code in theory would just be a blanket format of all of the data in columns B-G, however I hoped that if it was able to automate the process in general it would be a start. So I changed the text to fit my needs (essentially the same macro) and changed the formatting rules to format based on numbers:

excel help 6.png

When I try to run the program nothing happens- and I am wondering if a piece of the code is incorrect. Additionally, what code would be required to format every three rows (with all three key figures present), and would this be the best way to automate this process in general?

Second question: 

Once this formatting is complete, I wish to copy the formatted colors in the six columns of the rows associated with Supplier Network DOH, and copy those colors without the rules or the values to the six Total Inventory cells below for each item. The purpose of this to be able to show with the use of conditional formatting Days on Hand risk- through color layered over the total inventory. I found a related article discussion: https://stackoverflow.com/questions/18548156/how-to-copy-the-conditional-formatting-without-copying-..., however copy and pasting just the color themselves did not work on my Windows 10 excel version. Is there a way to do this process as well?

Sorry for the long questions- but I would appreciate any help I can get.

1 Reply

@adisera 

Here was the code- I didn't realize it came out weird in the text box.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
17 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies