Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default COUNTA msgbox


I'm not sure if this is possible but I have been trying to create
macro that would do a COUNTA function on a selected range and displa
the result in a message box

i.e.

Dim Rangea As Range
Dim Resulta As Variant

Rangea = selelected.Range
Resulta = Application.WorksheetFunctions.counta.Rangea
MsgBox Resulta

It doesn't come close to working so can anyone suggest a way o
accomplishing this?

Cheers :

--
Damin
-----------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...fo&userid=2707
View this thread: http://www.excelforum.com/showthread.php?threadid=49212

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default COUNTA msgbox

try this

worksheetfunction.CountA(columns("B:B"))

fill some entries in columnB
and type this in immediate window
?worksheetfunction.CountA(columns("B:B"))
what do you get


"Daminc" wrote in
message ...

I'm not sure if this is possible but I have been trying to create a
macro that would do a COUNTA function on a selected range and display
the result in a message box

i.e.

Dim Rangea As Range
Dim Resulta As Variant

Rangea = selelected.Range
Resulta = Application.WorksheetFunctions.counta.Rangea
MsgBox Resulta

It doesn't come close to working so can anyone suggest a way of
accomplishing this?

Cheers :)


--
Daminc
------------------------------------------------------------------------
Daminc's Profile:

http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=492124



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default COUNTA msgbox


MsgBox WorksheetFunction.CountA(Selection)

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Daminc" wrote:


I'm not sure if this is possible but I have been trying to create a
macro that would do a COUNTA function on a selected range and display
the result in a message box

i.e.

Dim Rangea As Range
Dim Resulta As Variant

Rangea = selelected.Range
Resulta = Application.WorksheetFunctions.counta.Rangea
MsgBox Resulta

It doesn't come close to working so can anyone suggest a way of
accomplishing this?

Cheers :)


--
Daminc
------------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=492124


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default COUNTA msgbox

Hi Daminc,

Dim Rangea As Range
Dim Resulta As Variant

Rangea = selelected.Range
Resulta = Application.WorksheetFunctions.counta.Rangea
MsgBox Resulta


Close:

Dim Rangea As Range
Dim Resulta As Variant

Set Rangea = selelected.Range
Resulta = Application.WorksheetFunctions.counta(Rangea)
MsgBox Resulta

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default COUNTA msgbox

Dim result As Integer
result = WorksheetFunction.Counta(Selection)
MsgBox result


--
Gordon Rainsford

London UK


Daminc wrote:

I'm not sure if this is possible but I have been trying to create amacro

that would do a COUNTA function on a selected range and displaythe
result in a message box

i.e.

Dim Rangea As Range
Dim Resulta As Variant

Rangea = selelected.Range
Resulta = Application.WorksheetFunctions.counta.Rangea
MsgBox Resulta

It doesn't come close to working so can anyone suggest a way
ofaccomplishing this?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default COUNTA msgbox

Hi Daminc,

You have several code suggestions. However, this information is available
directly in the report on the right-hand side of the status bar,


---
Regards,
Norman



"Daminc" wrote in
message ...

I'm not sure if this is possible but I have been trying to create a
macro that would do a COUNTA function on a selected range and display
the result in a message box

i.e.

Dim Rangea As Range
Dim Resulta As Variant

Rangea = selelected.Range
Resulta = Application.WorksheetFunctions.counta.Rangea
MsgBox Resulta

It doesn't come close to working so can anyone suggest a way of
accomplishing this?

Cheers :)


--
Daminc
------------------------------------------------------------------------
Daminc's Profile:
http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=492124



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default COUNTA msgbox


Thanks for your replies.

There are several suggestions that work great here for what I wante
and a lot more food for thought in the bargain :)

I'm not sure where this info is though:
-"However, this information is available directly in the report on th
right-hand side of the status bar,"

--
Damin
-----------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...fo&userid=2707
View this thread: http://www.excelforum.com/showthread.php?threadid=49212

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default COUNTA msgbox

Hi Daminc,

I'm not sure where this info is though:
-"However, this information is available directly in the report on the
right-hand side of the status bar,"-


If you select some cells, the staus bar can show a number of statistics
(on the right hand side): SUM, COUNT, AVERAGE, MIN, MAX. Rightclick the
status bar to activate this or change the function used.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default COUNTA msgbox

Hi Daminc,

Just to add to Jan Karels's response, if you do not see the Status Bar then:

Tools Options | View | Check 'Status Bar'

---
Regards,
Norman



"Daminc" wrote in
message ...

Thanks for your replies.

There are several suggestions that work great here for what I wanted
and a lot more food for thought in the bargain :)

I'm not sure where this info is though:
-"However, this information is available directly in the report on the
right-hand side of the status bar,"-


--
Daminc
------------------------------------------------------------------------
Daminc's Profile:
http://www.excelforum.com/member.php...o&userid=27074
View this thread: http://www.excelforum.com/showthread...hreadid=492124



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default COUNTA msgbox


Found it :)

Cheers guy

--
Damin
-----------------------------------------------------------------------
Daminc's Profile: http://www.excelforum.com/member.php...fo&userid=2707
View this thread: http://www.excelforum.com/showthread.php?threadid=49212



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
counta Graham Excel Discussion (Misc queries) 2 May 22nd 09 12:13 PM
COUNTA? Paul Excel Worksheet Functions 3 January 13th 09 04:34 PM
COUNTA() Michell Major Excel Discussion (Misc queries) 5 October 17th 06 03:34 PM
using COUNTA DougMc Excel Discussion (Misc queries) 4 May 30th 05 12:57 AM
COUNTA Function not working =COUNTA(C3:C69,"NH") MikeinNH Excel Worksheet Functions 2 November 8th 04 01:19 AM


All times are GMT +1. The time now is 01:21 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"