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