Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Frequency FormulaArray Syntax

Hi Excel Forum,

I'm using Excel's Frequency function in a VBA.

The Worksheet Syntax:

FREQUENCY(data_array, bins_array)

It must be must be entered as an array formula.

This is what I've got working so far in the macro VBA:

Range("R4C6:R17C6").FormulaArray = "=Frequency(R4C3:R34C3,R4C5:R17C5)
--- This works o.k: so far, so good.

However, I need the above VBA formula to be flexible enough to tak
into account that, the last cell in the range at the moment (R34C3
last part of the Frequency data_array syntax) will vary and I want t
avoid manually editing the VBA code each time it changes.

I've tried to expand on the above working Formula Array that uses th
fixed range of R4C3:R34C3, omitting the R34C3.

Range("R4C6:R17C6").Value = Application.Frequency(Range("R4C3
R4C5:R17C5", ActiveSheet.Range("R4C3").End(xlDown))).Row

As you can see: I've made a hash of it! Error: Run-time error 1004
Range method of Worksheet class failed.

Can you provide a VBA Formula that will work if I only have the star
cell range, i.e. R4C3.

Please advise and assist with a working example.

Thank you
QT

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Frequency FormulaArray Syntax

See answer in Worksheet Functinons... no need to post to
several groups...


-----Original Message-----
Hi Excel Forum,

I'm using Excel's Frequency function in a VBA.

The Worksheet Syntax:

FREQUENCY(data_array, bins_array)

It must be must be entered as an array formula.

This is what I've got working so far in the macro VBA:

Range("R4C6:R17C6").FormulaArray = "=Frequency

(R4C3:R34C3,R4C5:R17C5)"
--- This works o.k: so far, so good.

However, I need the above VBA formula to be flexible

enough to take
into account that, the last cell in the range at the

moment (R34C3 -
last part of the Frequency data_array syntax) will vary

and I want to
avoid manually editing the VBA code each time it changes.

I've tried to expand on the above working Formula Array

that uses the
fixed range of R4C3:R34C3, omitting the R34C3.

Range("R4C6:R17C6").Value = Application.Frequency(Range

("R4C3,
R4C5:R17C5", ActiveSheet.Range("R4C3").End(xlDown))).Row

As you can see: I've made a hash of it! Error: Run-time

error 1004:
Range method of Worksheet class failed.

Can you provide a VBA Formula that will work if I only

have the start
cell range, i.e. R4C3.

Please advise and assist with a working example.

Thank you
QTE


---
Message posted from http://www.ExcelForum.com/

.

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
FormulaArray Troy Excel Worksheet Functions 1 November 23rd 04 03:42 PM
Converting to R1C1 in FormulaArray Ken McLennan[_3_] Excel Programming 4 June 9th 04 03:30 AM
FormulaArray..... HELP !!! Pierre[_6_] Excel Programming 4 May 5th 04 09:37 PM
FormulaArray with existing cell Michael Singmin Excel Programming 4 March 6th 04 03:55 PM
FormulaArray UK[_2_] Excel Programming 2 February 23rd 04 05:39 PM


All times are GMT +1. The time now is 07:18 AM.

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"