VBA Changing interior color based on value of another cell in same row

sunilkaru

New Member
Joined
Oct 22, 2019
Messages
1
Dear All

i have a data base and i need to change back ground color of a cell based on value of another cell in the same row. for an example, how to change color of A1 , if C1 got a date value (only type of value)? other types are email and blank. so I need to change 3 different colors?

A1B1C1
PO20054G02073521-Oct-19

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,233
Office Version
365
Platform
Windows
Welcome to the MrExcel board!

Do you really need VBA? Could you just use Conditional formatting like this?

Excel Workbook
ABC
1PO20054G02073521-Oct-19
2PO20055G020736
3PO20056G020737abc@def.com
4PO20057G02073824-Oct-19
CF Date Blank Email
Conditional Formatting
CellConditionFormat
A11. / Formula is =FIND("@",C1)Abc
A12. / Formula is =C1=""Abc
A13. / Formula is =AND(C1<>"",ISERROR(FIND("@",C1)))Abc
 
Last edited:

Forum statistics

Threads
1,081,899
Messages
5,361,928
Members
400,666
Latest member
UDLearning

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top