+ Reply to Thread
Results 1 to 20 of 20

add missed item under item into list based on matching with sheet name

  1. #1
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    add missed item under item into list based on matching with sheet name

    Hello
    in CREATE LIST sheet I want matching items in column C with sheets names and brings the items for DESCRIBE column & value for TOTAL column and put missed item under item is matched with sheet name and summing .
    if there is duplicates item in the sheet ,then should merge and summing amount as in PUR EXPENSES sheet .
    so the result should put missed items under PUR EXPENSES & GENERAL EXPENSES as highlighted by green color as in H:J
    should brings any missed items under item in CREAT LIST sheet with same way if the sheet name is existed in the list for CREAT LIST sheet to match with sheets names .
    current code will match column C CREATE LIST sheet with sheets names and brings & summing the values for TOTAL column into column B for CREATE LIST sheet with exclude red cells will calculate and add formula , the red cell will change in location after add missed items .
    when add new items should not involve within the formula when sum because it's part of summing have already summed before add missed items based on original code , so no need to enter missed items within summing and you can check the total for NET PUR, NET INCOME will not change after add missed items .
    also posted here
    https://www.mrexcel.com/board/thread...issed.1235498/

    thanks
    Attached Files Attached Files
    Last edited by abdo M; 04-26-2023 at 01:43 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: add missed item under item into list based on matching with sheet name

    Hello my friend. I think there may be a language barrier here. I've read through your request several times and I'm still not clear on all that you're asking for. I think that's why you've not received much response. If there's any way you can be more clear with the language in your request I think it may help. As it stands, your request is very confusing for an English reader.

  3. #3
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    current code will match the items in column C for CREAT list sheet with each sheet name , then will populate values in column B for CREAT list sheet by summing the TOTAL column for every sheet and will calculate for each separately cell is highlighted by red .
    if you compare the result A:C before with H:J after will you understand the missed items are highlighted by green color even my English language is not enough clear .
    items PUR EXPENSES & GENERAL EXPENSES are existed in column C for CREAT list sheet and when search this names across sheets will find sheets names are PUR EXPENSES & GENERAL EXPENSES, then will brings items from DESCRIBE column for theses sheets and put under where PUR EXPENSES & GENERAL EXPENSES are existed in column C for CREAT list sheet .
    so the question is what is not clear for you ?

  4. #4
    Registered User
    Join Date
    12-30-2021
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    51

    Re: add missed item under item into list based on matching with sheet name

    Still confusing. For example, you don't have a sheet named "COST OF THE GOODS TO BE SOLD".

  5. #5
    Registered User
    Join Date
    12-30-2021
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    51

    Re: add missed item under item into list based on matching with sheet name

    You may try to use short sentences to describe your intention and give an example. It seems to me that you want to use VBA to write the sum of column Total in worksheet "PUR" to Cell I2 of worksheet "CREATE LIST". Am I right?

  6. #6
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    you don't have a sheet named "COST OF THE GOODS TO BE SOLD".
    any cell is highlighted by red should exclude from all of conditions I mentioned ,will just calculate as in original code
    will add formulas for red cells consecutively as in this line
    Please Login or Register  to view this content.
    Last edited by abdo M; 04-26-2023 at 12:49 PM.

  7. #7
    Registered User
    Join Date
    12-30-2021
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    51

    Re: add missed item under item into list based on matching with sheet name

    OK. You want to screen out those highlighted cells. Do you want to put the calculated sum in Column B of Worksheet 'CREATE LIST'?

  8. #8
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    Do you want to put the calculated sum in Column B of Worksheet 'CREATE LIST'?
    yes as the original code does it .

  9. #9
    Registered User
    Join Date
    12-30-2021
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    51

    Re: add missed item under item into list based on matching with sheet name

    It seems that I understand your intention. Are those row numbers 6,8,10,15,16,and 18 dynamic or fixed? If they are fixed, why bothering to highlight cells in Column C?

  10. #10
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    It seems that I understand your intention. Are those row numbers 6,8,10,15,16,and 18 dynamic or fixed? If they are fixed, why bothering to highlight cells in Column C?
    in earlier and based on original code yes , but now should be dynamic after add missed item and red cell will change in location .
    Last edited by abdo M; 04-26-2023 at 01:26 PM.

  11. #11
    Registered User
    Join Date
    12-30-2021
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    51

    Re: add missed item under item into list based on matching with sheet name

    Your code works. What do you want next?

  12. #12
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    I know the code works , but I search for another macro to populate missed items for PUR EXPENSES & GENERAL EXPENSES
    in PUR EXPENSES sheet contains Goods transport rental & Hire of unloading workers in column B should put under PUR EXPENSES in column C and should merge duplicates column TOTAL and put in column B for adjacent cells for Goods transport rental & Hire of unloading workers in CREAT LIST sheet , and the same thing for GENERAL EXPENSES sheet .
    just see the green missed items how they were A: C and how become H:J

  13. #13
    Registered User
    Join Date
    12-30-2021
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    51

    Re: add missed item under item into list based on matching with sheet name

    It is hard to understand if you put a whole paragraph as one sentence. Let me rephrase it. You want Cells I4 and I5 be partial sums of Totals from worksheet "PUR EXPENSES". Am I right? If so, just call WorksheetFunction.Sumif or WorksheetFunction.Sumifs.

  14. #14
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    You want Cells I4 and I5 be partial sums of Totals from worksheet "PUR EXPENSES". Am I right?
    yes that's correct .
    If so, just call WorksheetFunction.Sumif or WorksheetFunction.Sumifs.
    can you show me how do that, please?

  15. #15
    Registered User
    Join Date
    12-30-2021
    Location
    Toronto
    MS-Off Ver
    365
    Posts
    51

    Re: add missed item under item into list based on matching with sheet name

    Sub J3v17()
    Dim Chk As Long

    Chk = Application.Match("Total", Worksheets("PUR EXPENSES").Rows(1), 0)
    Worksheets("CREATE LIST").Cells(4, 9).Value = _
    Application.WorksheetFunction.SumIfs(Worksheets("PUR EXPENSES").Columns(Chk), _
    Worksheets("PUR EXPENSES").Columns(2), Worksheets("CREATE LIST").Cells(4, 10).Value)
    Worksheets("CREATE LIST").Cells(5, 9).Value = _
    Application.WorksheetFunction.SumIfs(Worksheets("PUR EXPENSES").Columns(Chk), _
    Worksheets("PUR EXPENSES").Columns(2), Worksheets("CREATE LIST").Cells(5, 10).Value)

    Chk = Application.Match("Total", Worksheets("GENERAL EXPENSES").Rows(1), 0)
    Worksheets("CREATE LIST").Cells(20, 9).Value = _
    Application.WorksheetFunction.SumIfs(Worksheets("GENERAL EXPENSES").Columns(Chk), _
    Worksheets("GENERAL EXPENSES").Columns(2), Worksheets("CREATE LIST").Cells(20, 10).Value)
    Worksheets("CREATE LIST").Cells(21, 9).Value = _
    Application.WorksheetFunction.SumIfs(Worksheets("GENERAL EXPENSES").Columns(Chk), _
    Worksheets("GENERAL EXPENSES").Columns(2), Worksheets("CREATE LIST").Cells(21, 10).Value)
    End Sub

  16. #16
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    this is not what I expect, should add miss item automatically.
    anyway thank you

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: add missed item under item into list based on matching with sheet name

    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    @jindon
    wow !
    your way is awesome ! , brings the whole data .
    just I have a problem about number format the code seems delete it from column I if I do manually by cells formatting>
    can you fix it please?

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: add missed item under item into list based on matching with sheet name

    Add one line in bold
    Please Login or Register  to view this content.

  20. #20
    Forum Contributor
    Join Date
    05-25-2022
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    225

    Re: add missed item under item into list based on matching with sheet name

    thanks very much

+ 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] populate amount for each item name into column based on matching sheet name
    By abdo M in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2023, 08:09 AM
  2. [SOLVED] add specific item into last item for whole item based on where precede item
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-28-2022, 03:25 PM
  3. Replies: 6
    Last Post: 06-23-2019, 11:07 PM
  4. [SOLVED] Formula needed - line item of unique item matching criteria
    By NS4Excel in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-18-2015, 06:32 PM
  5. Replies: 5
    Last Post: 07-26-2011, 10:35 PM
  6. Replies: 9
    Last Post: 05-21-2011, 12:14 AM
  7. Taking the next item in a list into 1 of 2 tables based on the previous item time
    By SoleAris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2011, 04:59 PM

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