Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
BruceK
 
Posts: n/a
Default Arrays parameters in Functions

I can't seem to get the syntax right on this VBA statement:

I want to use a similar statement to :
ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[1]C[6]:R[10]C[6] , R[1]C[6] )"

except that the array parameter "R[1]C[6]:R[10]C[6]" needs to be specified
using row and column variables.

Possibly something close to

ActiveCell.FormulaR1C1 = "=PERCENTRANK( ActiveSheet.Range(Cells(1, 6),
Cells(lastrow, 6)) , R[1]C[6] )"

Can anyone help me fix the syntax or offer another approach? Thanks

  #2   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi


ActiveCell.Formula = "=PERCENTRANK(F1:F10, F1)"

or

ActiveCell.Formula = "=PERCENTRANK(F1:F" & NumericExpression & ", F1)"



--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )




"BruceK" wrote in message
...
I can't seem to get the syntax right on this VBA statement:

I want to use a similar statement to :
ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[1]C[6]:R[10]C[6] ,
R[1]C[6] )"

except that the array parameter "R[1]C[6]:R[10]C[6]" needs to be
specified
using row and column variables.

Possibly something close to

ActiveCell.FormulaR1C1 = "=PERCENTRANK( ActiveSheet.Range(Cells(1, 6),
Cells(lastrow, 6)) , R[1]C[6] )"

Can anyone help me fix the syntax or offer another approach? Thanks



  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Arvi showed you using Formula, but if you need to use FormulaR1C1 to provide
column and row variability, just build up bit by bit

ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[" & firstRow & "]C[" & firstCol &
"]:R[" & _
lastRow & "]C[" & lastCol & "] ,
R[" & firstRow & "]C[" & fisrCol & "] )"

just as an example to show the approach

--
HTH

Bob Phillips

"Arvi Laanemets" wrote in message
...
Hi


ActiveCell.Formula = "=PERCENTRANK(F1:F10, F1)"

or

ActiveCell.Formula = "=PERCENTRANK(F1:F" & NumericExpression & ", F1)"



--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )




"BruceK" wrote in message
...
I can't seem to get the syntax right on this VBA statement:

I want to use a similar statement to :
ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[1]C[6]:R[10]C[6] ,
R[1]C[6] )"

except that the array parameter "R[1]C[6]:R[10]C[6]" needs to be
specified
using row and column variables.

Possibly something close to

ActiveCell.FormulaR1C1 = "=PERCENTRANK( ActiveSheet.Range(Cells(1, 6),
Cells(lastrow, 6)) , R[1]C[6] )"

Can anyone help me fix the syntax or offer another approach? Thanks





  #4   Report Post  
BruceK
 
Posts: n/a
Default

Thanks. Not really that hard, once you finally see the solution. I
appreciate the help.
Bruce


"Bob Phillips" wrote:

Arvi showed you using Formula, but if you need to use FormulaR1C1 to provide
column and row variability, just build up bit by bit

ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[" & firstRow & "]C[" & firstCol &
"]:R[" & _
lastRow & "]C[" & lastCol & "] ,
R[" & firstRow & "]C[" & fisrCol & "] )"

just as an example to show the approach

--
HTH

Bob Phillips

"Arvi Laanemets" wrote in message
...
Hi


ActiveCell.Formula = "=PERCENTRANK(F1:F10, F1)"

or

ActiveCell.Formula = "=PERCENTRANK(F1:F" & NumericExpression & ", F1)"



--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )




"BruceK" wrote in message
...
I can't seem to get the syntax right on this VBA statement:

I want to use a similar statement to :
ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[1]C[6]:R[10]C[6] ,
R[1]C[6] )"

except that the array parameter "R[1]C[6]:R[10]C[6]" needs to be
specified
using row and column variables.

Possibly something close to

ActiveCell.FormulaR1C1 = "=PERCENTRANK( ActiveSheet.Range(Cells(1, 6),
Cells(lastrow, 6)) , R[1]C[6] )"

Can anyone help me fix the syntax or offer another approach? Thanks






  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

Exactly, once you know the basics, you can take it a long way <g

Bob

"BruceK" wrote in message
...
Thanks. Not really that hard, once you finally see the solution. I
appreciate the help.
Bruce


"Bob Phillips" wrote:

Arvi showed you using Formula, but if you need to use FormulaR1C1 to

provide
column and row variability, just build up bit by bit

ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[" & firstRow & "]C[" &

firstCol &
"]:R[" & _
lastRow & "]C[" & lastCol &

"] ,
R[" & firstRow & "]C[" & fisrCol & "] )"

just as an example to show the approach

--
HTH

Bob Phillips

"Arvi Laanemets" wrote in message
...
Hi


ActiveCell.Formula = "=PERCENTRANK(F1:F10, F1)"

or

ActiveCell.Formula = "=PERCENTRANK(F1:F" & NumericExpression & ", F1)"



--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )




"BruceK" wrote in message
...
I can't seem to get the syntax right on this VBA statement:

I want to use a similar statement to :
ActiveCell.FormulaR1C1 = "=PERCENTRANK( R[1]C[6]:R[10]C[6] ,
R[1]C[6] )"

except that the array parameter "R[1]C[6]:R[10]C[6]" needs to be
specified
using row and column variables.

Possibly something close to

ActiveCell.FormulaR1C1 = "=PERCENTRANK( ActiveSheet.Range(Cells(1,

6),
Cells(lastrow, 6)) , R[1]C[6] )"

Can anyone help me fix the syntax or offer another approach? Thanks








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
Default User Defined Functions - How? flycast Excel Discussion (Misc queries) 4 May 26th 05 04:26 AM
PASTE DOWN FUNCTIONS jackle Excel Worksheet Functions 0 May 25th 05 02:10 PM
Parameters are not allowed in queries that can't be displayed grap Flora Tzeng Excel Discussion (Misc queries) 1 March 15th 05 10:34 AM
3 questions about automated c++ com add-in worksheet functions gert Excel Worksheet Functions 0 March 10th 05 09:57 AM
# of Functions per cell SUB-ZERO Excel Worksheet Functions 3 January 23rd 05 10:35 PM


All times are GMT +1. The time now is 04:18 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"