PC Review


Reply
Thread Tools Rate Thread

CountA formila for a varying range

 
 
Simon
Guest
Posts: n/a
 
      11th Jul 2008
Sub Count()

Dim Work As Workbook
Dim Figures As Workbook

Set Work = Workbooks.Open("N:Work.csv")
Set Figures = Workbooks.Open("N:\Figures June.xls")

Work.Activate
Range("A1").Select
RngA = Range(Selection, Selection.End(xlDown)).Select
Figures.Activate

ActiveCell.FormulaR1C1 = "=COUNTA(DALWork!R1C1:RngA)"
'ActiveRange = "=COUNTA(Selection)"

'RngA states True

End Sub

What should I put in the formula instead of RngA?
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      11th Jul 2008
How about

ActiveCell.Formula = "=COUNTA(" & RngA.Address(,,,True) & ")"


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Simon" <(E-Mail Removed)> wrote in message
news:b8a8de1c-b1bf-4038-85a8-(E-Mail Removed)...
> Sub Count()
>
> Dim Work As Workbook
> Dim Figures As Workbook
>
> Set Work = Workbooks.Open("N:Work.csv")
> Set Figures = Workbooks.Open("N:\Figures June.xls")
>
> Work.Activate
> Range("A1").Select
> RngA = Range(Selection, Selection.End(xlDown)).Select
> Figures.Activate
>
> ActiveCell.FormulaR1C1 = "=COUNTA(DALWork!R1C1:RngA)"
> 'ActiveRange = "=COUNTA(Selection)"
>
> 'RngA states True
>
> End Sub
>
> What should I put in the formula instead of RngA?



 
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
dynamic range counta error sammy.peters@gmail.com Microsoft Excel Programming 8 20th Aug 2007 02:08 PM
Using Counta with a range =?Utf-8?B?TWljaGFlbCBXaGl0bmV5?= Microsoft Excel Programming 4 16th Oct 2006 11:01 PM
Re: Dynamic range without using COUNTA($X:$X) Harlan Grove Microsoft Excel Worksheet Functions 0 5th Sep 2004 12:33 AM
Re: Dynamic range without using COUNTA($X:$X) Aladin Akyurek Microsoft Excel Worksheet Functions 0 3rd Sep 2004 09:55 PM
Re: Dynamic range without using COUNTA($X:$X) Frank Kabel Microsoft Excel Worksheet Functions 2 3rd Sep 2004 09:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:38 PM.