+ Reply to Thread
Results 1 to 9 of 9

Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet name

  1. #1
    Registered User
    Join Date
    06-07-2023
    Location
    Libya
    MS-Off Ver
    office 2019
    Posts
    29

    Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet name

    Hi
    I have this sample file contains small data . in RESULT sheet I write sheets names in column B. so I want macthing with sheets names and merge amount in column (TOTAL) for each sheet and populate in column C. th column TOTAL will change in location so should match TOTAL word is existed in header with exclude row contains INVOICES TOTAL in last row for each INVOICE from th merging if it's existed in any sheet.
    every time I add new sheets and change TOTAL column in location .
    I want looping in spcific sheets . not all of sheet in workbook because I have others sheets I don't implementing for them.
    don't touch any formula is existed in column C .
    I look forward from the experts write smart code espicially if the data could become big in (8000 rows for each sheets
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    I want looping in spcific sheets . not all of sheet in workbook because I have others sheets I don't implementing for them
    So how do we know which sheets to include/exclude?

    And add the word "TOTAL" where needed e.g A9 in "STOCK"

    with formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 04-29-2024 at 05:47 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    06-07-2023
    Location
    Libya
    MS-Off Ver
    office 2019
    Posts
    29

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    So how do we know which sheets to include/exclude?
    just put sheets in array like this
    ("SVS","CDV","STOK")
    thanks for th formulas , but I want vba .
    I don't want changing range in the formula when change TOTAL column in location every time.
    thanks .

  4. #4
    Forum Contributor
    Join Date
    09-18-2023
    Location
    Geogia, USA
    MS-Off Ver
    365
    Posts
    118

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    I took a slightly different approach using VBA

    Please Login or Register  to view this content.
    The code loops through the sheets (but not the last one as it is the results sheet)
    Looks to see if the sheet name is on the results sheet, if it is then it totals the values
    Attached Images Attached Images
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    don't want changing range in the formula when change TOTAL column in location every time.
    I you looked at the formula you will see there no need to change any range as they are full columns.

  6. #6
    Registered User
    Join Date
    06-07-2023
    Location
    Libya
    MS-Off Ver
    office 2019
    Posts
    29

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    @jdelano
    thank you so much.

  7. #7
    Registered User
    Join Date
    06-07-2023
    Location
    Libya
    MS-Off Ver
    office 2019
    Posts
    29

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    I you looked at the formula you will see there no need to change any range as they are full columns.
    well if I have add new sheets with new location for TOTAL column I should write new formula for new sheet !
    any way thank you.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    Equally you have to change the VBA UNLESS the only sheet NOT to the processed is "RESULT" which conflicts with your previous statements (as per my reply in post #2).

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,369

    Re: Match TOTAL word across sheet and merging TOTAL amount for each sheet based on sheet n

    I added a sheet to the file but the VBA does not to cater for this as it matches the sheets names in column B so you have to list all relevant sheets in column B: so not totally "automated"!

+ 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. [SOLVED] exclude TOTAL row and sum TOTAL column based on sheet name
    By KalilMe in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 07-02-2023, 02:30 PM
  2. 2 workbooks, Find values in sheet, total them up, move total to other book?
    By excelgirl84 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-13-2022, 06:31 AM
  3. [SOLVED] Calculate total amount partially based on Yearly from other sheet.
    By Abdur_rahman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-11-2020, 10:03 AM
  4. Replies: 9
    Last Post: 09-20-2015, 11:30 AM
  5. Sales Record Sheet total with certain amount off or percentage off
    By Swaski in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2015, 07:06 PM
  6. How to transfer data from a daily input sheet to a separate monthly total sheet
    By Jcooper71 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2014, 02:37 PM
  7. Automatic post total amount in pivot table to another sheet
    By chongchingsoo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2011, 01:01 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