Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Variable Range Reference

The following code doesn't work with a Method Range of object Global failed
error

For b = 6 To 15
Set rng = Range(Cells(3, b))
rng.Select
Selection.FormulaArray = "=PERCENTILE(R52C4:R" & c & "C4,R2C" & b &
")"
Next

But if I hard code the destination cell i.e. Set rng = Range("f3") it will
work for that one cell. What am I doing wrong in naming this range? Any
help is greatly appreciated.

Also, is there an On Exit event for a cell?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Variable Range Reference

Set rng = Range(Cells(3, b))

should be

Set rng = Cells(3, b)

--
Regards,
Tom Ogilvy

"Bob" wrote in message
...
The following code doesn't work with a Method Range of object Global

failed
error

For b = 6 To 15
Set rng = Range(Cells(3, b))
rng.Select
Selection.FormulaArray = "=PERCENTILE(R52C4:R" & c & "C4,R2C" & b

&
")"
Next

But if I hard code the destination cell i.e. Set rng = Range("f3") it

will
work for that one cell. What am I doing wrong in naming this range? Any
help is greatly appreciated.

Also, is there an On Exit event for a cell?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Variable Range Reference

Try:

For b = 6 to 15
Set rng = Cells(3,b)
rng.FormulaArray = "=PERCENTILE(R52C4:R" & c & "C4,R2C" & b & ")"
Next b

Ray at work


"Bob" wrote in message
...
The following code doesn't work with a Method Range of object Global

failed
error

For b = 6 To 15
Set rng = Range(Cells(3, b))
rng.Select
Selection.FormulaArray = "=PERCENTILE(R52C4:R" & c & "C4,R2C" & b

&
")"
Next

But if I hard code the destination cell i.e. Set rng = Range("f3") it

will
work for that one cell. What am I doing wrong in naming this range? Any
help is greatly appreciated.

Also, is there an On Exit event for a cell?



  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Variable Range Reference

Of course, thanks.

"Tom Ogilvy" wrote:

Set rng = Range(Cells(3, b))

should be

Set rng = Cells(3, b)

--
Regards,
Tom Ogilvy

"Bob" wrote in message
...
The following code doesn't work with a Method Range of object Global

failed
error

For b = 6 To 15
Set rng = Range(Cells(3, b))
rng.Select
Selection.FormulaArray = "=PERCENTILE(R52C4:R" & c & "C4,R2C" & b

&
")"
Next

But if I hard code the destination cell i.e. Set rng = Range("f3") it

will
work for that one cell. What am I doing wrong in naming this range? Any
help is greatly appreciated.

Also, is there an On Exit event for a cell?




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
How to reference variable range? WhatsUp31415 Excel Discussion (Misc queries) 4 May 17th 09 07:20 PM
Variable Cell Range Reference Ken Excel Worksheet Functions 3 August 12th 07 07:35 PM
VLOOKUP variable range cell reference Ohp Excel Worksheet Functions 2 July 3rd 07 02:52 PM
Variable range reference Kyle Szukaitis Excel Discussion (Misc queries) 1 October 21st 05 03:10 AM
A function to get a variable row reference for range in XNPV funct Tex1960 Excel Worksheet Functions 6 August 1st 05 11:20 PM


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