LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default count # of elemnts in a column

good morning,

i've this problem.

i need a method to count the number og elemnts i get in a column, let
say column A and use this number to set the range for my formulas and
loop.

i tried this:

dim h as integer

Range("M2").Select
ActiveCell.FormulaR1C1 = "=IF(R[-1]C[-12]=0,0,1)"
Selection.AutoFill destination:=Range("M2:M15000")
Range("M15001").Select
h = ActiveCell.FormulaR1C1 = "=SUM(R[-14999]C:R[-1]C)"

(whit this formula, in column M, i set 1 if there is an value in A else
0. then h is the sum on all the values in Column M.)

and then

Range("G2").Select
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
Range("G2").Select
Selection.AutoFill destination:=Range(.Cells(7, 2), .Cells(7, h))

or also

Range("G2").Select
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
Range("G2").Select
Selection.AutoFill destination:=Range("g2:gh")

but it does not work.

what i'm wrong?


thank's in advance



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

 
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
how to count#cells w/= value in other column and not count blank c aganoe Excel Worksheet Functions 4 April 9th 10 11:36 AM
Count number of cells and total in one column, based on another column suffix Pierre Excel Worksheet Functions 5 October 31st 07 12:28 AM
Count Intervals of 1 Numeric value in a Row and Return Count down Column Sam via OfficeKB.com Excel Worksheet Functions 8 October 4th 05 04:37 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
COUNT INFORMATION IN COLUMN B ONLY IF A1 MATCHES K1 COUNT THAT CE. witchcat98 Excel Worksheet Functions 1 February 4th 05 01:38 PM


All times are GMT +1. The time now is 08:04 AM.

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"