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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
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))
 

RickeyS

Board Regular
Joined
Jun 23, 2006
Messages
222
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
 

RickeyS

Board Regular
Joined
Jun 23, 2006
Messages
222
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,029
Messages
5,856,933
Members
431,840
Latest member
simplysoph

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