Solved

Excel macro help

Posted on 2015-02-18
4
111 Views
Last Modified: 2015-03-04
Hi ,

I am working on a build sheet where we will be doing checks manually now.
I need your help to automate the 3 tasks.

1. Spell check
2. Highlight rows which dont have any plots. (In the attached row 4 has no plots)
3. Highlight columns which have unique plots.(in the attached column F and H has unique plots)

For spell check , i find the below macro online from excel tricks. but i need your help on adding the task2 and 3 with this macro.
Sub ColorMispelledCells()
For Each cl In ActiveSheet.UsedRange
If Not Application.CheckSpelling(Word:=cl.Text) Then _
cl.Interior.ColorIndex = 28
Next cl
End Sub

The attached is only sample and the column/row may be varied.

Thanks
0
Comment
Question by:magento
[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
  • 3
4 Comments
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40618266
No attachment
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40618292
HI,

pls try

For Each rw In ActiveSheet.UsedRange.Rows
    Debug.Print Application.CountA(rw)
    If Application.CountA(rw) = 0 Then
        rw.Interior.ColorIndex = 28
    End If
Next rw
For Each cl In ActiveSheet.UsedRange.Columns
    If Application.CountA(cl) = 1 Then
        cl.Interior.ColorIndex = 28
    End If
Next rw

Open in new window

Regards
0
 
LVL 5

Author Comment

by:magento
ID: 40618304
Sorry , Please find the attachment .
plot-ee.xlsx
0
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40618329
Hi,

pls try

Sub Macro()

Set myRange = Range(Range("F3"), Cells(Range("E" & Rows.Count).End(xlUp).Row, Cells(1, Columns.Count).End(xlToLeft).Column))
For Each rw In myRange.Rows
    Debug.Print Application.CountA(rw)
    If Application.CountA(rw) = 0 Then
        rw.Interior.ColorIndex = 20
    End If
Next rw
For Each cl In myRange.Columns
    If Application.CountA(cl) = 0 Then
        cl.Interior.ColorIndex = 20
    End If
Next

End Sub

Open in new window

Regards EDIT Variable number of cols
0

Featured Post

Independent Software Vendors: 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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

707 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