+ Reply to Thread
Results 1 to 3 of 3

variables inside a formula??

  1. #1
    Registered User
    Join Date
    12-29-2004
    Posts
    37

    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.

  2. #2
    Udo
    Guest

    Re: 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. #3
    Registered User
    Join Date
    12-29-2004
    Posts
    37

    Talking ya ha!

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1