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


here's what I have
ActiveCell.FormulaR1C1 = "=sum(R[-176]C:R[-1]C)"

trouble is the rows are not always the same and I want to use a
variable
instead of a fix number.

ActiveCell.FormulaR1C1 = "=sum(R[variableX]C:R[variableY]C)"
variableX being the top of the column and variableY being the cell
above the
active cell. I can't seem to get it to recognize variableX and
variableY

I thought this would be simple enough, but it's driving me
nuts.


--
zerosleep
------------------------------------------------------------------------
zerosleep's Profile: http://www.excelforum.com/member.php...o&userid=17846
View this thread: http://www.excelforum.com/showthread...hreadid=517795

  #2   Report Post  
Posted to microsoft.public.excel.programming
Udo Udo is offline
external usenet poster
 
Posts: 48
Default variables inside a formula??

Hi zerosleep,

try to connect the different parts of the formula like text:
ActiveCell.FormulaR1C1 = "=Sum(R[-" & (Var1- (Var2 + 1)) & "]C:R[-1]C)"

Hope this helps and you can again sleep fine (at least at home)

Udo

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default variables inside a formula??


thank you Udo!

that helped alot. I tried all that, but I couldn't get the " and the &

straight so it didn't work for me. thanks to you I was able to see
how that works and now everything is peachy...:)

I should just head home and crawl into bed! THANKS again.


--
zerosleep
------------------------------------------------------------------------
zerosleep's Profile: http://www.excelforum.com/member.php...o&userid=17846
View this thread: http://www.excelforum.com/showthread...hreadid=517795

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
Vlookup inside a formula willemeulen[_4_] Excel Worksheet Functions 1 May 14th 09 10:33 AM
use CTRL key inside a formula Date Less[_2_] Excel Worksheet Functions 6 April 16th 08 01:58 AM
How to embed large number of variables in text inside a text box? Riva Chase Excel Discussion (Misc queries) 0 October 30th 07 01:42 AM
How to use text value inside a formula Gary[_17_] Excel Programming 3 May 12th 04 07:47 AM
looping with formula inside a.ekster Excel Programming 1 October 27th 03 03:30 AM


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