PC Review


Reply
Thread Tools Rate Thread

Count Non Blank Rows

 
 
Fredriksson via OfficeKB.com
Guest
Posts: n/a
 
      4th Apr 2007
I am trying to count the number of rows in a column that are non blank

Dim NumOfRows
Dim NumOfColumns
NumOfRows = CountA(Sheet1!$A:$A)
NumOfColumns = CountA(Sheet1!$2:$2)

the debugger keep erroring out at this line. Is there anouther function I
can use

--
Message posted via http://www.officekb.com

 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      4th Apr 2007
NumOfRows = Application.CountA(Sheet1.Columns("$A:$A"))
NumOfColumns = Application.CountA(Sheet1.Rows("$2:$2"))

Hgth,
Merjet


 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      4th Apr 2007
Dim NumOfRows
Dim NumOfColumns
NumOfRows = Application.CountA(Sheet1!$A:$A)
NumOfColumns = Application.CountA(Sheet1!$2:$2)

--
regards,
Tom Ogilvy


"Fredriksson via OfficeKB.com" wrote:

> I am trying to count the number of rows in a column that are non blank
>
> Dim NumOfRows
> Dim NumOfColumns
> NumOfRows = CountA(Sheet1!$A:$A)
> NumOfColumns = CountA(Sheet1!$2:$2)
>
> the debugger keep erroring out at this line. Is there anouther function I
> can use
>
> --
> Message posted via http://www.officekb.com
>
>

 
Reply With Quote
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      4th Apr 2007
try it this way:

With Worksheets("Sheet1")
NumOfRows = WorksheetFunction.CountA(.Range("A:A"))
NumOfColumns = WorksheetFunction.CountA(.Range("2:2"))
End With



--
Hope that helps.

Vergel Adriano


"Fredriksson via OfficeKB.com" wrote:

> I am trying to count the number of rows in a column that are non blank
>
> Dim NumOfRows
> Dim NumOfColumns
> NumOfRows = CountA(Sheet1!$A:$A)
> NumOfColumns = CountA(Sheet1!$2:$2)
>
> the debugger keep erroring out at this line. Is there anouther function I
> can use
>
> --
> Message posted via http://www.officekb.com
>
>

 
Reply With Quote
 
Fredriksson via OfficeKB.com
Guest
Posts: n/a
 
      4th Apr 2007
Thanks I appreciate the help

Vergel Adriano wrote:
>try it this way:
>
>With Worksheets("Sheet1")
> NumOfRows = WorksheetFunction.CountA(.Range("A:A"))
> NumOfColumns = WorksheetFunction.CountA(.Range("2:2"))
>End With
>
>> I am trying to count the number of rows in a column that are non blank
>>

>[quoted text clipped - 5 lines]
>> the debugger keep erroring out at this line. Is there anouther function I
>> can use


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200704/1

 
Reply With Quote
 
Helmut Weber
Guest
Posts: n/a
 
      4th Apr 2007
Hi Tom,

Sub Test447()
Msgbox = Application.CountA(Sheet1!$A:$A)
End Sub

First I get "Invalid character" and the first $-sign is highlighted.
After switching languages (english-german, german-english),
to and fro, I get syntax-error.

Maybe it has to do with localization.
Though I'm using an US-version,
date and time settings interfere every now and then.
When and why, nobody knows.

How would Application.CountA(Sheet1!$A:$A) look
when using cells(row,column) instead of $A:$A.

Help for CountA tells me:
The page cannot be displayed.

I'm lost.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"



 
Reply With Quote
 
Fredriksson via OfficeKB.com
Guest
Posts: n/a
 
      4th Apr 2007
Thanks I appreciate the help
Tom Ogilvy wrote:
>Dim NumOfRows
>Dim NumOfColumns
>NumOfRows = Application.CountA(Sheet1!$A:$A)
>NumOfColumns = Application.CountA(Sheet1!$2:$2)
>
>> I am trying to count the number of rows in a column that are non blank
>>

>[quoted text clipped - 5 lines]
>> the debugger keep erroring out at this line. Is there anouther function I
>> can use


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200704/1

 
Reply With Quote
 
Jim Rech
Guest
Posts: n/a
 
      4th Apr 2007
Try:

Application.CountA(Range("Sheet1!$A:$A"))

--
Jim
"Helmut Weber" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| Hi Tom,
|
| Sub Test447()
| Msgbox = Application.CountA(Sheet1!$A:$A)
| End Sub
|
| First I get "Invalid character" and the first $-sign is highlighted.
| After switching languages (english-german, german-english),
| to and fro, I get syntax-error.
|
| Maybe it has to do with localization.
| Though I'm using an US-version,
| date and time settings interfere every now and then.
| When and why, nobody knows.
|
| How would Application.CountA(Sheet1!$A:$A) look
| when using cells(row,column) instead of $A:$A.
|
| Help for CountA tells me:
| The page cannot be displayed.
|
| I'm lost.
|
| --
| Greetings from Bavaria, Germany
|
| Helmut Weber, MVP WordVBA
|
| Win XP, Office 2003
| "red.sys" & Chr$(64) & "t-online.de"
|
|
|


 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      4th Apr 2007
whoops -
I need to make another adjustment


Dim NumOfRows
Dim NumOfColumns
NumOfRows = Application.CountA([Sheet1!$A:$A])
NumOfColumns = Application.CountA([Sheet1!$2:$2])

0r

Dim NumOfRows
Dim NumOfColumns
With Worksheets("Sheet1")
NumOfRows = Application.CountA(.range("A:A"))
NumOfColumns = Application.CountA(.Range("2:2"))


--
Regards,
Tom Ogilvy


"Fredriksson via OfficeKB.com" wrote:

> Thanks I appreciate the help
> Tom Ogilvy wrote:
> >Dim NumOfRows
> >Dim NumOfColumns
> >NumOfRows = Application.CountA(Sheet1!$A:$A)
> >NumOfColumns = Application.CountA(Sheet1!$2:$2)
> >
> >> I am trying to count the number of rows in a column that are non blank
> >>

> >[quoted text clipped - 5 lines]
> >> the debugger keep erroring out at this line. Is there anouther function I
> >> can use

>
> --
> Message posted via OfficeKB.com
> http://www.officekb.com/Uwe/Forums.a...mming/200704/1
>
>

 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      4th Apr 2007
Unfortunately, I just focused on the first error I came to - see my followup
posting for a more complete response.

--
Regards,
Tom Ogilvy



"Helmut Weber" wrote:

> Hi Tom,
>
> Sub Test447()
> Msgbox = Application.CountA(Sheet1!$A:$A)
> End Sub
>
> First I get "Invalid character" and the first $-sign is highlighted.
> After switching languages (english-german, german-english),
> to and fro, I get syntax-error.
>
> Maybe it has to do with localization.
> Though I'm using an US-version,
> date and time settings interfere every now and then.
> When and why, nobody knows.
>
> How would Application.CountA(Sheet1!$A:$A) look
> when using cells(row,column) instead of $A:$A.
>
> Help for CountA tells me:
> The page cannot be displayed.
>
> I'm lost.
>
> --
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP WordVBA
>
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
count how many rows contain nonblank in column A and blank in colu Vic Microsoft Excel Misc 5 8th Apr 2009 07:42 PM
How do I count non blank rows only? Susan Mc Microsoft Excel New Users 3 22nd Jun 2008 03:35 PM
count rows till cell is blank =?Utf-8?B?SnVuaW9yNzI4?= Microsoft Excel Programming 7 13th Apr 2007 01:14 PM
How to count blank cells (Rows) between Non-Blank cells in Col "A" Dennis Microsoft Excel Misc 8 20th Jul 2006 11:25 PM
Count Non-Blank Rows =?Utf-8?B?TGF6emFyb25p?= Microsoft Excel Worksheet Functions 12 28th Apr 2006 07:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 AM.