Wrox Programmer Forums
BOOK: Excel VBA 24-Hour Trainer
This is the forum to discuss the Wrox book Excel VBA 24-Hour Trainer by Tom Urtis; ISBN: 978-0-470-89069-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel VBA 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 23rd, 2011, 11:02 PM
Registered User
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Excel VBA Question

I want to find the cell which are not filled with color in selected range and want to color the non-filled cells.

Is there any macro for this.

I'm unknown to VBA.

PLease reply.

Old September 6th, 2011, 11:20 AM
JP JP is offline
Authorized User
Join Date: Apr 2008
Posts: 57
Thanks: 1
Thanked 3 Times in 3 Posts

This is air code, I didn't test it. You'll need to specify what color you want the non-filled cells to be.

Sub FindNonFilledCells()
Dim rng As Excel.Range
Dim cell As Excel.Range
Set rng = Selection
Application.ScreenUpdating = False
For Each cell In rng
  If cell.Interior.ColorIndex = -4142 Then ' no fill color
    ' what color do you want?
    ' cell.Interior.ColorIndex = ???
  End If
Next cell
Application.ScreenUpdating = True
End Sub
JP SoftTech

Similar Threads
Thread Thread Starter Forum Replies Last Post
#NAME? error running Excel 2003 VBA in Excel 2007 steveburn Excel VBA 0 October 24th, 2009 08:47 AM
Question about " Calculate " in VBA Excel ? poorheler Excel VBA 3 July 9th, 2007 01:20 AM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
A simple question about date in VBA for Excel 2002 Trancefuzion Excel VBA 2 July 29th, 2004 04:37 AM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.