+ Reply to Thread
Results 1 to 4 of 4

Insert Active Formula in Excel Cell with VBA

  1. #1
    Registered User
    Join Date
    07-03-2008
    Location
    Adelaide
    Posts
    3

    Angry Insert Active Formula in Excel Cell with VBA

    I am trying to get my VBA code to insert an active "Total" formula (ie like an autosum entry into an excel cell of "=Sum(D3:D56)") to sum a column of values, and update any subsequent changes to the values in that column. I can get the VBA code to sum the column and enter the result in the cell but it then does not change when a value in that cell changes.

    I am a new VBA user so any help would be appreciated.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon trex46

    ...and welcome to the forum!!

    Does something like this work out OK for you :
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    07-03-2008
    Location
    Adelaide
    Posts
    3

    Smile

    Thanks very much dominicb for your help.

    It was not exactly what I wanted and no doubt due to my poor explanation of my needs. The issue was that the cell receiving the sum formula (A15 in your formula) and the end cell of data (A10 in your formula) can vary depending on the amount of data lines in the spreadsheet.

    However what you suggested gave me enough to then come up with the following;-

    Please Login or Register  to view this content.
    It provided a result although there may be a better and shorter way of doing it. If so I would be happy to receive the suggestion.

    Thanks again
    trex46
    Last edited by dominicb; 07-04-2008 at 11:05 AM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Maybe
    Please Login or Register  to view this content.

+ 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