Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Testing a range for blanks

I have a spreadsheet that has 5000+ rows. Some of the rows have cells 3-10
as blanks. I need to report when these cells are blank. Is there a simple
way to test the range for blanks or do I need to cycle through each cells and
evaluate them?

Thanks in advance.

Guy Normandeau

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Testing a range for blanks

Hi Guy,

Try something like:

'=============
Public Sub Tester()
Dim rng As Range
Dim rng2 As Range

Set rng = Range("C1:J5000")

On Error Resume Next
Set rng2 = rng.SpecialCells(xlBlanks)
On Error GoTo 0

If Not rng2 Is Nothing Then
'do something, e.g.:
rng2.Cells.Interior.ColorIndex = 6
End If
End Sub
'<<=============



---
Regards,
Norman


"Guy Normandeau" wrote in message
...
I have a spreadsheet that has 5000+ rows. Some of the rows have cells 3-10
as blanks. I need to report when these cells are blank. Is there a
simple
way to test the range for blanks or do I need to cycle through each cells
and
evaluate them?

Thanks in advance.

Guy Normandeau



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TESTING A RANGE OF CELLS Richard[_2_] Excel Worksheet Functions 3 April 1st 07 02:52 PM
Testing for a consistent value counting blanks [email protected] Excel Worksheet Functions 1 February 14th 07 09:52 PM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Worksheet Functions 1 September 3rd 06 07:56 PM
testing whether the ActiveCell is in a given range Paul Ponzelli Excel Programming 2 August 10th 05 05:20 PM
Testing for content in Range Jim McLeod[_3_] Excel Programming 1 July 13th 04 05:58 PM


All times are GMT +1. The time now is 09:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"