Solved

Excel VBA column Null Color RED

Posted on 2011-09-12
2
276 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

705 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