Highlight Cells using Spinbutton

pwill

Active Member
Joined
Nov 22, 2015
Messages
406
Hi can anyone help with a formula?

I have a spin button form on sheet1 that increments the values by 1 in the linked cell "A3"

does anyone know a formula I can add to conditional formatting that will add fill colour to cells in range "D5:D26" each time the value in the linked cell "A3" increases by 1.

So if linked cell "A3" value is 0 then "D5" Fill colour is goes red then when the spin button increases the value in "A3" by 1 the Fill colour goes to the next cell in the range and "D6" would then be filled red instead of "D5" and so on...

ie

if "A3" = 0 then "D5" = red fill
if "A3" = 1 then "D6" = red fill
if "A3" = 2 then "D7" = red fill

Any help would be appreciated

regards

pwill
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Create a custom conditional format for Cell D5 with the following formula:

Code:
=(ROW()-5)=$A$3

Set the format to red fill.

Then select that cell and copy.

Then select D6:D26 and do a paste special "format"
 
Upvote 0
I just realized that because A3 is static... it's even easier.

Just select D5:D26 and create a new conditional format with that formula.

No need to copy and paste special.
 
Upvote 0
Thank you BAlGaIl, that works perfect, much appreciated :)

pwill
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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