VBA code for formating needed

RickeyS

Board Regular
Joined
Jun 23, 2006
Messages
222
My problem:
I have a range of cells (C16:C43) on sheet (week3&4).
These cells contain text.
I need code to look up and match text on sheet (employees)(cells B5:B43) and when it finds a match if column D is not blank do nothing but if it is blank turn cell on sheet (week3&4) red.

I tried to do this with conditional formatting but it dosn't allow you to do something from another sheet.

Thanks
Rick
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You can't use a CF formula like this:

=ISNUMBER(MATCH(C16,Employees!B5:B43,FALSE))

but if you name Employees!B5:B43 say List with Insert|Name|Define, you can use:

=ISNUMBER(MATCH(C16,List,FALSE))
 
Upvote 0
I get error:
"You may not use references to other work sheets or workbooks for conditional formatting criteria"
when I try to use formula in conditional formatting.
So do I need to do this in VBA code? or is there some other way?

Thanks
Rick
 
Upvote 0
Thanks for help I got it to work with this formula,
=IF(ISBLANK(VLOOKUP(C16,employeelist,3,FALSE)),TRUE,FALSE)
not sure if this is the best way or not but it works when used in conditional formatting.

Thanks again,
Rick
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,795
Members
449,468
Latest member
AGreen17

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