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

hi,

I have the following:

Dim CountActual As Integer
Range("c7:c" & lastactioncode).select
MsgBox lastactioncode
'Range("Z1").Formula = "=COUNTA(C7:C4715)"
Range("Z1").Formula = "=COUNTA(C7:C) & lastactioncode"
CountActual = Range("Z1").Value
MsgBox CountActual

When I use the part that is commented out, I DO NOT get an error. However,
when I use the Range("Z1").Formula = "=COUNTA(C7:C) & lastactioncode"
part, I do not get an error, but "0" appears as the value for CountActual.
Then I look in the Z1 cell, and I se the formula is as follows:
=COUNTA($G:Z) & lastactioncode

How can I solve this?

Thanks in advance,
geebee

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default COUNTA

Try this...

Range("Z1").Formula = "=COUNTA(C7:C" & lastactioncode & ")"

--
HTH...

Jim Thomlinson


"geebee" wrote:

hi,

I have the following:

Dim CountActual As Integer
Range("c7:c" & lastactioncode).select
MsgBox lastactioncode
'Range("Z1").Formula = "=COUNTA(C7:C4715)"
Range("Z1").Formula = "=COUNTA(C7:C) & lastactioncode"
CountActual = Range("Z1").Value
MsgBox CountActual

When I use the part that is commented out, I DO NOT get an error. However,
when I use the Range("Z1").Formula = "=COUNTA(C7:C) & lastactioncode"
part, I do not get an error, but "0" appears as the value for CountActual.
Then I look in the Z1 cell, and I se the formula is as follows:
=COUNTA($G:Z) & lastactioncode

How can I solve this?

Thanks in advance,
geebee

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

Thanks. This worked beautifully. I forgot about this... it's been a while.



"Jim Thomlinson" wrote:

Try this...

Range("Z1").Formula = "=COUNTA(C7:C" & lastactioncode & ")"

--
HTH...

Jim Thomlinson


"geebee" wrote:

hi,

I have the following:

Dim CountActual As Integer
Range("c7:c" & lastactioncode).select
MsgBox lastactioncode
'Range("Z1").Formula = "=COUNTA(C7:C4715)"
Range("Z1").Formula = "=COUNTA(C7:C) & lastactioncode"
CountActual = Range("Z1").Value
MsgBox CountActual

When I use the part that is commented out, I DO NOT get an error. However,
when I use the Range("Z1").Formula = "=COUNTA(C7:C) & lastactioncode"
part, I do not get an error, but "0" appears as the value for CountActual.
Then I look in the Z1 cell, and I se the formula is as follows:
=COUNTA($G:Z) & lastactioncode

How can I solve this?

Thanks in advance,
geebee

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 carlee Excel Discussion (Misc queries) 2 January 14th 10 10:28 AM
COUNTA? Paul Excel Worksheet Functions 3 January 13th 09 04:34 PM
COUNTA Q Seanie Excel Worksheet Functions 4 November 22nd 08 11:00 AM
COUNTA Karen Excel Worksheet Functions 3 January 10th 06 09:48 PM
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 10:15 PM.

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

About Us

"It's about Microsoft Excel"