can you make a macro automatially fill a cell with a certain colour?

manaz

New Member
Joined
Mar 18, 2009
Messages
15
Can anyone tell me if you can write a macro to inset a certain colour (fill) into a row of information once a specific cell has an entry entered (ie is not blank)

Cheers
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,128
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. Mobile
  3. Web
Re: can yo make a macro automatially fill a cell with a certain colour?

Yes

Not by macro but by Conditional Formatting highlight the cell you wish to highlight then use Format>>Condition Formatting>>Formula Is: =A1=""

Given A1 is the blank cell you refer to

EDIT: Yes a Macro can do it but try the built-in function first
 
Last edited:
Upvote 0

manaz

New Member
Joined
Mar 18, 2009
Messages
15
thats great thanks, but can you make it fill the row that the specific cell is in, i.e. cell N3 has text in it and yo want to highlight fom column A3 to N3?
 
Upvote 0

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

Sure,

Just select A3:Nxx for as many rows as you want to apply the formatting and use =$N3<>"" (note the $)

HTH,
 
Upvote 0

manaz

New Member
Joined
Mar 18, 2009
Messages
15
thanks that worked perfect, but i would like it to apply to a whole sheet, so every cell in column 'N' that has text in it is highlighted from column 'A' to 'L'.
 
Upvote 0

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Select column A then hold down the Shift key, End Key + Down Arrow key, then still holding down the shift key use the right arrow key until you get to N. Then open Conditional Formatting and apply your formula.

Or use the mouse to select the columns.
 
Upvote 0

Forum statistics

Threads
1,191,416
Messages
5,986,438
Members
440,030
Latest member
ninomato

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
Top