LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default Help! Limit on number of Ranges you can use at one time?

Hello -

I have the following code:

Dim numBlanks As Integer
numBlanks = 0
'For Each c In Range("D8:D240")
For Each c In Range("D8:D16, D17:D22, D23:D27, D29:D31, D33:D42, D44:D50,
D52:D57, D59:D78, D80:D83, D85:D86," & _
"D88:D94, D102:D105, D107:D111, D113:D115, D123:D128, D135:D136,
D143:D144, D146, D154:D156," & _
"D158:D159, D167:D170, D172:D174, D176, D178:D179, D187:D189, D191:D197,
D212")

'The following line is commented out
', D214:D218, D221:D230, D237:D240")

If c.Value = "" Then
numBlanks = numBlanks + 1
End If
Next c

MsgBox "The number of blank rows is: " & numBlanks

Note I have commented out the code for:
', D214:D218, D221:D230, D237:D240")

This runs fine until I try to put one more range in from the commented line;
e.g. D214:D218 (or either of the other two for that matter). I obviously
need to include these three ranges.

I am getting the following error:
Run-time error '1004'
Method 'Range' or object '_Worksheet' failed.
When I click on the help button of the error, it comes up totally blank.

Is there some limit on the amount of ranges you can use at one time? If
that's the case, is there some kind of workaround? If not, does anyone know
what is causing this?

Any help will be greatly appreciated!
--
Sandy
 
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
limit on [h]:mm time format? Stefi Excel Discussion (Misc queries) 14 February 22nd 07 10:30 AM
Limit to number of named ranges before Excel starts messing things up? S Davis Excel Worksheet Functions 3 September 12th 06 08:07 PM
macro to time limit workbook ditchy Excel Discussion (Misc queries) 5 April 26th 05 08:43 AM
How can i work a formula for time limit? Roze Excel Worksheet Functions 2 November 25th 04 02:41 PM
set time limit before closing sheet Maria Johansson Excel Programming 2 October 14th 03 08:00 AM


All times are GMT +1. The time now is 04:02 AM.

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

About Us

"It's about Microsoft Excel"