?
Solved

Excel VBA column Null Color RED

Posted on 2011-09-12
2
Medium Priority
?
278 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:
JP earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
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…

752 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