Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8202749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:18:01+00:00 2026-06-07T07:18:01+00:00

I have the following worksheet called Data : In the same workbook I have

  • 0

I have the following worksheet called Data:
enter image description here

In the same workbook I have another worksheet called Employee Database.
enter image description here

In Excel, how can I color the “Employee E-mail Address” and the corresponding “Company” and “Company URL” cells red from the Data worksheet if the “Employee E-mail Address” is not in the Employee Database?

In otherwords, I am trying to make the Employee Database worksheet look like this:
enter image description here

I’ve just given an example and in reality I have over 10,000 cells worth of data to do this to. I started doing this manually and realized it will take me forever.

I’d love to know if there is a macro that can do this in Excel?

Help would be so much appreciated! I have the example workbook of the screenshots above available for download here:
http://www.mediafire.com/?dttztp66dvjkzn8

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:18:03+00:00Added an answer on June 7, 2026 at 7:18 am

    Is this what you are trying? This will create a new sheet “Desired Result” with the output. Paste this in a module.

    Option Explicit
    
    Sub Sample()
        Dim wsData As Worksheet, wsDB As Worksheet, wsO As Worksheet
        Dim lRow As Long, i As Long
        Dim clrRng As Range
    
        Set wsData = Sheets("Data")
        Set wsDB = Sheets("Employee Database")
        Set wsO = Sheets.Add
    
        On Error Resume Next
        Application.DisplayAlerts = False
        Sheets("Desired Result").Delete
        Application.DisplayAlerts = True
        On Error GoTo 0
    
        With wsO
            .Name = "Desired Result"
            wsData.Cells.Copy .Cells
    
            lRow = .Range("B" & .Rows.Count).End(xlUp).Row
    
            For i = 2 To lRow
                If .Range("A" & i).Value = "" Then .Range("A" & i).Value = .Range("A" & i - 1).Value
            Next i
    
            For i = 1 To lRow
                If Application.WorksheetFunction.CountIf(wsDB.Columns(3), .Range("A" & i).Value) = 0 Then
                    If clrRng Is Nothing Then
                        Set clrRng = .Rows(i)
                    Else
                        Set clrRng = Union(clrRng, .Rows(i))
                    End If
                End If
            Next i
    
            If Not clrRng Is Nothing Then clrRng.Interior.ColorIndex = 3
    
            For i = lRow To 2 Step -1
                If .Range("A" & i).Value = .Range("A" & i - 1).Value Then .Range("A" & i).ClearContents
            Next i
        End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Excel worksheet: | A B C -+--------------- 1|id date views
I have the following routine that dumps a DataTable into an Excel worksheet. private
I have an Excel worksheet that has the following macro. I'd like to loop
I have the following code: Excel.Range range = workSheet.UsedRange; for (rowCount = 2; rowCount
I have the following C# code, which pulls data from a database & populates
I have the following code: Private Sub SortWorksheet(ByVal sheet As Worksheet) Dim sStartColumn Dim
I have following div in a page (I can not modify). <div id=:0.control>Click me</div>
I have following question on adobe omniture How we can register an iPhone app
I have the following vba: Data is all text, Rows A - J with
I am trying to create an Excel workbook where I can auto-set, or auto-adjust

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.