Solved

Excel macro help

Posted on 2015-02-18
4
95 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
  • 3
4 Comments
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 40618266
No attachment
0
 
LVL 48

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 48

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now