+ Reply to Thread
Results 1 to 9 of 9

VB code to isert sumup formula

  1. #1
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    VB code to isert sumup formula

    Hi,

    I'm trying to figure out a worksheet activation code that would insert the sum up formula below the last data row of column "T" and sum up all the values above the formula.

    Any help on this would be kindly appreciated.
    Thanks in Advance.
    Cheers,
    adsm

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: VB code to isert sumup formula

    Not entirely clear but perhaps:

    Please Login or Register  to view this content.
    above is obviously even driven code and should reside in VBE behind whichever sheet object you wish to apply it to

  3. #3
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: VB code to isert sumup formula

    Thanks for the code, That's what I was searching for. I've added sum few lines to the code.

    Here is the current version.
    Please Login or Register  to view this content.
    How could I incorporate the following formula into column E below the last data row.
    =SpellCurr($T$10,"Dollar","S","Cent","S")

    For example if the formula
    .FormulaR1C1 = "=SUM(R1C:R[-1]C)" is in T10, then

    the formula =SpellCurr($T$10,"Dollar","S","Cent","S") will show $T$10.

    If the formula
    .FormulaR1C1 = "=SUM(R1C:R[-1]C)" is in T11 the formula will show as

    =SpellCurr($T$11,"Dollar","S","Cent","S") in column E below the last data row.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: VB code to isert sumup formula

    Perhaps....

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: VB code to isert sumup formula

    Thanks for the help once again. If I may ask one more help how could I make the row where the formulas appear to bold and the row to be highlighted in Grey.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: VB code to isert sumup formula

    Please Login or Register  to view this content.
    revise colour index per preference

  7. #7
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: VB code to isert sumup formula

    The code colors the entire row. How could I make it to only color from column D to T.

    Please Login or Register  to view this content.
    I've tried with the above code but it doesn't work for me?

    Any help would be kindly appreciated.

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: VB code to isert sumup formula

    Re: above code - out of context it's hard to follow - use of Static variables etc...

    In terms of revising my prior sample:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: VB code to isert sumup formula

    Thanks for the help & I do really appreciate your help.

+ 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