Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
counta | Excel Discussion (Misc queries) | |||
COUNTA? | Excel Worksheet Functions | |||
COUNTA() | Excel Discussion (Misc queries) | |||
using COUNTA | Excel Discussion (Misc queries) | |||
COUNTA Function not working =COUNTA(C3:C69,"NH") | Excel Worksheet Functions |