Results 1 to 6 of 6

Why does Excel change my RC Formula?

Threaded View

Phil_V Why does Excel change my RC... 08-06-2008, 05:55 AM
ravishankar macro 08-06-2008, 06:27 AM
shg You're entering the formula... 08-06-2008, 07:07 AM
Phil_V :eek: I think your answer... 08-06-2008, 07:10 AM
shg You could instead do ... 08-06-2008, 07:17 AM
ravishankar Hi Thanks phil for... 08-06-2008, 09:40 AM
  1. #1
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Question Why does Excel change my RC Formula?

    I am trying to do something that I thought would be easy (and I've simplified it!)

    I have a list of numbers in Column1 of a worksheet.
    I want to specify USING VBA that the formula in cell(4,4) of that sheet should be a SUM of all the cells in column1.

    If I manually select a cell in Sheet1 I can type in it:

    =SUM(C1)

    This works fine, and I get the result as expected.

    However my one line macro doesn't work:
        Worksheets(1).Cells(4, 4).Formula = "=SUM(C1)"
    For some reason when VBA puts this into the Excel cell, Excel decides that actually it would prefer the formula to be:

    =SUM(R[-3]C[-1])

    Which of course gives the wrong result.
    Does anyone know why this is happening?

    I've attached an example to illustrate the problem.
    In Cell(5,4) i have manually typed in "=SUM(C1)", and cell(4,4) is where the VBA code trys to put in the identical formula.

    Many thanks!
    Attached Files Attached Files

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