LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Counting blanks in range using VBA Offset

No, resize does not do that. If you have done

Insert=Name=Define
Name: = PasteStartCell
Refersto: whatever

then this will not change the definition of PasteStartCell - it will just
use it as an anchor:

Numblanks =
Application.WorksheetFunction.CountBlank(Range("Pa steStartCell").Offset(6553
5,1))

would be a single column from row 2 to row 65536

if you want the entire row

Numblanks =
Application.WorksheetFunction.CountBlank(Range("Pa steStartCell" _
).Offset(65535,1).EntireRow)





"ExcelMonkey" wrote in message
...
But does resize permanently change the range behind the name

PastCellStart?
I use this name elsewhere in my code and do not want to change the range
definition behind that name. If it does, I will not be able to use it.



"Tom Ogilvy" wrote:

You can't offset 65535 rows from row 2 since offset is zero based.

? range("A2").Offset(65534,0).Address
$A$65536


What you want is resize

Numblanks =

Application.WorksheetFunction.CountBlank(Range(Pas teStartCell.Resize(65535,1
)))

--
Regards,
Tom Ogilvy


"ExcelMonkey" wrote in message
...
I know how to define a range using Excel's Offset function

(OFFSET(Rows,
Columns, Height, Width))

But how do I do it using the VBA Offset function. It only includes
(OFFSET(Rows, Columns)).

I am trying to count the blank cells betwee rows 2 and rows 65236 on a
sheet. Row 2 is named PasteStartCell. I think the use below does not

define
a range between row 2 and row 65536. It simply defines row 65536 as I

am
offsetting row 2 by 65535 additional rows. How do I make it refer to

the
range itself. Note I do not what to select the range and it cannot

include
row 1

Numblanks =


Application.WorksheetFunction.CountBlank(Range(Pas teStartCell.Offset(65535,0
)))

Thanks






 
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
Counting Blanks JPDS Excel Discussion (Misc queries) 6 January 27th 10 02:21 PM
counting non-blanks DJK Moore New Users to Excel 2 January 8th 09 10:22 PM
counting blanks in a non-consecutive range jenniebentham Excel Discussion (Misc queries) 3 November 21st 07 01:38 PM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Worksheet Functions 1 September 3rd 06 07:56 PM
Counting blanks, either 1, 2 or 3 Steve Excel Worksheet Functions 5 January 14th 06 02:18 AM


All times are GMT +1. The time now is 04:16 PM.

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"