Solved

Excel VBA column Null Color RED

Posted on 2011-09-12
2
274 Views
Last Modified: 2012-05-12
I have a macro that copies sheet1 to sheet2.  

How would you say, after the macro finishes that

 "If column Z is null, then color column Z RED?"
0
Comment
Question by:ca1358
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
peetjh earned 500 total points
ID: 36525656
Try the attached code
Sub checkcolumnZ()
Dim lastrow As Long
lastrow = [z65536].End(xlUp).Row
If lastrow = 1 Then
    If Cells(lastrow, "Z").Value = "" Then
        Columns(26).Interior.ColorIndex = 3
        Else
        Columns(26).Interior.ColorIndex = 0
    End If
End If
End Sub

Open in new window

0
 

Author Closing Comment

by:ca1358
ID: 36529642
Thank you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question