+ Reply to Thread
Results 1 to 5 of 5

VBA to find last row, add subtotals and then reformat

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Wisconsin
    MS-Off Ver
    Excel 2013
    Posts
    49

    VBA to find last row, add subtotals and then reformat

    Is it possible to write VBA to find the last row and then sum up the values above and reformat?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,933

    Re: VBA to find last row, add subtotals and then reformat

    Simple answer. Yes. Assume your data is in column A beginning in row 1.
    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    Wisconsin
    MS-Off Ver
    Excel 2013
    Posts
    49

    Re: VBA to find last row, add subtotals and then reformat

    I have this code

    Please Login or Register  to view this content.
    It works great but it is populating the cells on the first worksheet with the values and not on the worksheet labeled "N".

  4. #4
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: VBA to find last row, add subtotals and then reformat

    Change worksheet.activate to worksheet.select

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,933

    Re: VBA to find last row, add subtotals and then reformat

    ....or change your code to the following as an alternate solution

    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)

Similar Threads

  1. VBA to find last row, add subtotals and then reformat
    By mklindquist0815 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2016, 05:14 PM
  2. Find the word Label and reformat the font to size 8
    By laliparker in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-19-2013, 09:56 AM
  3. [SOLVED] formula for =columns subtotals find the max value
    By duplik8 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-08-2013, 08:36 AM
  4. Need dynamic VBA code to find last row of data (one row before subtotals)
    By FELDY in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-16-2012, 02:44 PM
  5. Need to find formula(s) to reformat spread
    By DoubleOZiggy in forum Excel General
    Replies: 3
    Last Post: 05-16-2011, 03:17 PM
  6. Multiple criteria subtotals to find top 10
    By nmadd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2011, 04:16 PM
  7. Find subtotals of 160 each
    By Bpt22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-15-2005, 05:05 AM

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