Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FormulaR1C1 using variables

I want to do this but can't:

ActiveCell.FormulaR1C1 = "=MyFunction(R[variable]C[variable])"

What are my options?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default FormulaR1C1 using variables


Try something like

ActiveCell.FormulaR1C1 = _
"=MyFunction(R" & CStr(variable) & "C" & CStr(variable) & ")"

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com




On Wed, 21 Apr 2010 13:52:01 -0700, Cheah
wrote:

I want to do this but can't:

ActiveCell.FormulaR1C1 = "=MyFunction(R[variable]C[variable])"

What are my options?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default FormulaR1C1 using variables

ActiveCell.FormulaR1C1 = "=MyFunction(R" & varR & "C" & varC & ")"

"Cheah" wrote:

I want to do this but can't:

ActiveCell.FormulaR1C1 = "=MyFunction(R[variable]C[variable])"

What are my options?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default FormulaR1C1 using variables

Don't forget your []'s:

Dim Var1 as long
dim Var2 as long

var1 = 21
var2 = 23
ActiveCell.FormulaR1C1 = "=MyFunction(R[" & var1 & "]C[" & var2 & "])"





Cheah wrote:

I want to do this but can't:

ActiveCell.FormulaR1C1 = "=MyFunction(R[variable]C[variable])"

What are my options?


--

Dave Peterson
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
FormulaR1C1 ? Heather Excel Programming 4 September 16th 09 02:35 PM
What Does FormulaR1C1 Do? JLGWhiz Excel Programming 0 December 15th 06 12:19 AM
What Does FormulaR1C1 Do? Don Guillett Excel Programming 0 December 14th 06 10:33 PM
FormulaR1C1 D.S.[_3_] Excel Programming 2 January 2nd 04 12:03 AM
FormulaR1C1 D.S.[_3_] Excel Programming 0 January 1st 04 09:12 PM


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