Results 1 to 4 of 4

R1C1 Formulas

Threaded View

  1. #1
    Registered User
    Join Date
    10-11-2007
    Posts
    11

    R1C1 Formulas

    I am having a problem figuring out how to get the R1C1 forumula to accept a changing value. What I am trying to do is get a macro to calculate the average value of a column on a spreadsheet. However the number of columns changes depending on the spreadsheet. So I want it to count the columns and based on the number of columns counted, calculate the average for as many columns are on the spreadsheet.
    Sub paste()
            ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[(-columncount)]:RC[(-columncount)]))"
        ActiveCell.Offset(0, 1).Range("A1").Select
    End Sub
    How could I get VBA to accept columncount as a numerical value for the "R1C1Formula =" ?
    Last edited by thundermocos; 10-17-2007 at 03:57 PM.

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