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: 17
Default How to set formula with cell reference with a variable


I would like to set formula that includes a string variable in VBA. The
following
code caused "Runtime error 1004 Application-defined or Object-defined error"

dim strRow_Number as String
strRow_Number = "100"

ActiveCell.FormulaR1C1 = "=SUM(R[1]C[-2]:R[" & strRow_Number & "]C[-2])"

How can I set the formula with variables???



 
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
Using a variable spreadsheet reference in a formula 3Nails Excel Discussion (Misc queries) 6 October 26th 08 12:45 AM
Variable column reference in formula excel help acct[_2_] Excel Discussion (Misc queries) 2 January 16th 08 12:31 AM
XL how to change a cell reference in a formula to variable value? Bernard Excel Worksheet Functions 6 June 18th 07 09:22 AM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


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