+ Reply to Thread
Results 1 to 104 of 104

Macro/Code to Go Through Workbook and Build a Summary

  1. #1
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Macro/Code to Go Through Workbook and Build a Summary

    Hello and thanks for looking at my thread for help.

    I am working on a project for my work. My problem is that I am trying to build a summary page that will be feed from certain pages in the workbook. Problem is there will be times when a page(s) will copied and duplicated and then the totals from that page will not make it to the summary page unless manually steered to it again. I have found a couple Codes up here to try and do what I want, but not having much luck with it.

    My major problem is, I DON'T KNOW ANYTHING ABOUT VBA CODING. :-( So I am at a Serious loss and need help and someone to hold my hand, or better pick me up and walk me over the line.

    Hopefully I explained what I am trying to do, if not please let me know and I will try to explain it better.


    Create Summary Based on Shore Tank Reports. Cell B60. If possilble Pull Name of a Product from a Cell as well to place next to the Total on the Final Summary.

    Thanks for all you help.
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    You will need to explain some more with the help of your file.

    What you need to be done? In which sheets?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Thanks for the Reply.

    What I need to do is, to be able to fill out the Shore Tank Report. Once that form is filled out, I need to be able to move on to the next Shore Tank Report and fill that one out. Problem is, there is never a set number of shore tank reports you may need, so I have managed to figure out how to record a macro and manipulate it to allow me to duplicate a Gauge Sheet and Shore Tank Blank whenever I hit the button on the Gauge Sheet to create another set. What I want to be able to do is have a macro/code loop through the book and pull the Total at the bottom of the Shore Tank Report, Cell B60, and report it on a Summary Page. Eventually I would like to make it so I can have it pull the Total from the Shore Tank and Pull the Grade Name, Cell F10, and populate the Summary Sheet with it. Then have it loop through the work book again if needed and update those cells on the summary page if values have changes. I would need it to be able to Check the Product names on the Shore Tank, Cell F10, and compare it to others to see if the Names match any other ones so that it would give a total of all grades on a summary report not a total of each Shore Tank Report. There are a couple macros already in the work book that kind of do what I need, but I couldn't manipulate them to correctly to what I want.

  4. #4
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Also I don't know if this is even possible or not. But is there a way to make the Tab Name Reflect a Cell Value Name?

    Tab Name= Shore Tank (1) Once a user enters a Product Name in Cell F10, have the Tab Name Change to that Cell Value?

    Thanks,

  5. #5
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok, I figured out the Rename Sheets depending on Cell Value. Only issue I have now is that I have to place the button on all the sheets I want it to do that to. I'm not sure how to go about setting it to do it all sheets, based on a conditional loop value? Something like. IF E10="PRODUCT" AND F10="NOTEMPTY" RENAME TAB TO CELL F10.

  6. #6
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok I have updated my Example Sheet with codes I have tried using.

    What I am trying to do:

    1.) Have a macro/code loop through the work book and pull from the Summary at the bottom of the Shore Tank Reports and place the values onto a Summary page.

    I found a macro that loops through all the tabs and pastes those totals to new summary page every time. What I want to be able to do is, have that Macro/Code loop through and pull the info only fromt the Shore Tank Reports tabs, and Update the Summary page, instead of deleting it everytime and creating a new one.

    2.) Have a macro/code Pull the "Times, Date, and Events" from the Time Log tab and place that infomation on the Standard Wire tab also.

    I would like to have this code autoformat the Events so that the (Proper) Caseing was implented and so that the Times, Date, and Events were in order from Oldest to Newest.

    Please I really need some help on this, I am going nuts trying to make this work.
    Attached Files Attached Files

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Regarding 1 - How about creating an expected output sheet so we can sheet so we can see how you want the data to be displayed?

    You want to change the sheet names for each shore tank? Do you want this to be done on the click of a button for all sheets? Or as soon as a sheet is created and Product is filled in?

    How do you want the request 2 to be completed? What data should go where?

  8. #8
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I have updated my Example Report to show how the output should look. I would like to take this idea and implement it to a larger scale down the road, so I am really trying to wrap my head around the code, so I appreaciate your help and anxiously await your response.

    I would like the Summary to be able to Update so that if I added another set of Shore Tanks later on and Named the Product as a Product that already existed, it would Total up both Shore Tank Reports with the Same Product name.

    Ie.
    Shore Tank Report 1 = PBOB

    Shore Tank Report 2 = RBOB

    Shore Tank Report 3 =CBOB

    Shore Tank Report 4 =PBOB

    Shore Tank Report 5 =CRUDE OIL

    Shore Tank Report 6 =PBOB

    So I have (3) Shore Tank Reports thare PBOB, so I would like the Summary to be able to Update the Total PRODUCT PBOB to equal the total of all three reports, instead of listing three seperate PBOB totals in the Summary.

    As for the TAB names, it would be great if it would update immediately right after you changed the name, and if there were two of the same products and the tabs = the Product names, it would simply just add a number after it.

    IE.

    Shore Tank Report 1 = RBOB

    Shore Tank Report 2 - RBOB

    Tab Names would be

    RBOB (1)

    RBOB (2)

    Thanks again and much appreaciated for taking the time to help me out.

    Blank-Inventory-Sample.xlsm

    EDIT: I had to delete a couple TABS so reduce the file size. But hopefully you can still figure out what I was trying to do. The tabs were only 2 other sets of shore tanks.
    Last edited by midnightorion; 07-19-2012 at 05:25 PM.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Your file is confusing

    Do you need help in updating the Summary of Quantities Tab?

    Should B60 n B61 from all shore tank tabs be pulled up in the summary tab?
    From where should i get the product number?

  10. #10
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Thanks again.

    I would like to be able to loop through the work book and pull from each shore tank tab and update the summary tab.

    The Product number can be a Static Result that is always there if thats possible.

    I need it to be able to loop through and be able to recognize if a new shore tank was added, and update the summary accordingly.

    I was thinking maybe, have it pull the available Products from the Cover and Add them to the Product row on the Summary.
    Then have the loop go through the workbook and Match the Product on the Shore Tank Reports and update that value on the Summary accordingly.

    Oh and yes, the Values from B60 and B61 need to be pulled and displayed on the summary sheet.

  11. #11
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    This is the code I have been playing with I found else where. My problem is, with this code it pulls from all Sheets and also deletes the Summary Sheets and Adds a new one everytime instead of just updating the values.
    Any help would be greatly appreacited as I don't understand any of the code, but am trying to figure it out as I go along.

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    The Product number can be a Static Result that is always there if thats possible.
    What do you mean by Static result?

    Is it fine if the macro clears the entries in the summary tab, then goes thru each sheet and updates the values freshly?

  13. #13
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by arlu1201 View Post
    What do you mean by Static result?
    Static meaning, I can just type that in and leave them there, as I don't need them to change at all.

    Quote Originally Posted by arlu1201 View Post
    Is it fine if the macro clears the entries in the summary tab, then goes thru each sheet and updates the values freshly?
    That would be great, they code I pasted above, deletes the page everytime instead of refreshing it, which is what I am trying to accomplish. I'm sure that if I could figure that out, how to make it refresh only, I could apply this method to many other areas of my Project as well.

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    See if this works for you
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  15. #15
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok I just pasted the formula in the Module, but haven't dug into it yet. It seems as if it loops through the woork book, but doesn't pull the values yet?

  16. #16
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok, For some reason, the result of the Code is that it will cycle through the Workbook and paste the values in the upper portion of the workbook? Starting at CELL E2 to E6 and the Same for CELLS U2:U6 and X2:X6 and the results are all mangled.

  17. #17
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Also is there a way to have it cycle throught he work book, but not pull from hidden or very hidden tabs? I have tabs that are veryhidden so that I can create new Shore Tank and Gauge ticket from a blank one instead of duplicating the visible ones each time.

  18. #18
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I have found that if I Linked the Products Names to the Cover page, and then run the Code, the Values will populate the Totals Fields as they should. I need the Code to be able to Recognize that if there is more than one shore tank report with the same PRODUCT in the work book, to SUM up the Total of the two Reports and add them to the summary instead of listing and duplicating two of the same products on the summary output page.

    Any suggestions are greatly appreaciated.

    Thank you,

  19. #19
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by midnightorion View Post
    Ok, For some reason, the result of the Code is that it will cycle through the Workbook and paste the values in the upper portion of the workbook? Starting at CELL E2 to E6 and the Same for CELLS U2:U6 and X2:X6 and the results are all mangled.
    I ran it at my end and it worked fine. Weren't the details populated in the SUMMARY OF QUANTITIES tab?

    Quote Originally Posted by midnightorion View Post
    Also is there a way to have it cycle throught he work book, but not pull from hidden or very hidden tabs? I have tabs that are veryhidden so that I can create new Shore Tank and Gauge ticket from a blank one instead of duplicating the visible ones each time.
    Yeah we can handle this in 2 ways - either you can have the values in the hidden sheets blanked out so it doesnt figure in the summary or you can provide the sheet names and i can exclude them from the code.

    Quote Originally Posted by midnightorion View Post
    I have found that if I Linked the Products Names to the Cover page, and then run the Code, the Values will populate the Totals Fields as they should. I need the Code to be able to Recognize that if there is more than one shore tank report with the same PRODUCT in the work book, to SUM up the Total of the two Reports and add them to the summary instead of listing and duplicating two of the same products on the summary output page.
    Sure, i will provide you additional code to do the summations.

  20. #20
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by arlu1201 View Post
    I ran it at my end and it worked fine. Weren't the details populated in the SUMMARY OF QUANTITIES tab?
    If the Products fields have something in them, the code will run fine and populate as needed. But if the Products fields are empty and I try to run the code, it will Populate in the wrong areas. Isn't there a way to make it always populate in the correct area whether or not there is something in those fields already?



    Quote Originally Posted by arlu1201 View Post
    Yeah we can handle this in 2 ways - either you can have the values in the hidden sheets blanked out so it doesnt figure in the summary or you can provide the sheet names and i can exclude them from the code.
    The Sheet Names are the same as the Others? "Shore Tank" & "Gage Tic" I would need to Rename them to something different, then figure out how to make it so that when I click on the button on the gage tic tab to duplicate it based on the New Names. This shouldn't be difficult, I'm sure I can figure that out. I will get on that and let you know what the New Names are so that they can be exluded.


    Quote Originally Posted by arlu1201 View Post
    Sure, i will provide you additional code to do the summations.
    That would be great. Could you possibly put comments in code that tell me what each line does? I would really like to understand and learn this, so that I could someday help someone else up here out as well. I am more of a hands on person, so reading and applying is very difficult for me while trial and error I can usually trudge through and figure out fairly well. Your help is much appreciated, thank you.

  21. #21
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Do you have any update on this part ?

    The Sheet Names are the same as the Others? "Shore Tank" & "Gage Tic" I would need to Rename them to something different, then figure out how to make it so that when I click on the button on the gage tic tab to duplicate it based on the New Names. This shouldn't be difficult, I'm sure I can figure that out. I will get on that and let you know what the New Names are so that they can be excuded.

  22. #22
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Hey sorry about that. I didn't come up with any idea of how to go about it yet. I was thinking chaging the name to something different and then when you click on the make new shore tank button, have it copy the hidden originals and rename them to Shore Tank (1) and Gauge Tic (1) then when you enter the Product Name in the copy have it Rename to Shore Tank "Name of Product", and Gauge Tic "Name of Product". Is that possible? If it is, then the name for the Originals could be anything, something like "Tank Guage Tic" and "Tank Report".

  23. #23
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    You could even name the sheets as "Template1" and "Template2" so that the macro does not pick up those sheets.

    Actually the code states that we need to pick all sheets that start with "Shore Tank", so even if we have those words in reverse order will do.

    So which other part requires to be solved?

  24. #24
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    How do I make it copy and then rename the TAB? I don't know the code or how to go about doing that?

    ---------- Post added at 02:36 PM ---------- Previous post was at 01:23 PM ----------

    I figured out how to make it rename the Sheet. But my problem now is, how do I make it rename to "Shore Tank" and then the next copy to "Shore Tank 2" and so on?

  25. #25
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I am stuck on this one? I have it set to copy the two sheet together so the links stay together, then I have it to rename the sheets to Shore Tank and Gauge Tic respectively. But now I need it check if Shore Tank and Gauge Tic names exist and if so name the next compied sheets to Shore Tank (2) & Gauge Tic (2) and so on. Any help?

  26. #26
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    So the code to copy and rename the sheets comes first and then the consolidation into a summary?

    What is the name of the sheet which you will be making a copy of, which is going to be your template?

    It will be good if you list out the steps of what you need and i can build you a complete code to accomplish that and even merge the code i gave you previously with this.
    Last edited by arlu1201; 08-04-2012 at 01:05 PM.

  27. #27
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    The name of the Sheets to be copied is now called Tank Template and Gauge Template. I need the creation of the sheets to take place at any time, cause you never know if you are completely done, or if all of a sudden you need another set of sheets. It would be good if you could press a button on the summary sheet to then go through and check for the values.

    Updated....
    Blank-Inventory-Sample.xlsm
    Last edited by midnightorion; 08-04-2012 at 01:12 PM. Reason: Uploaded new sample sheet

  28. #28
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok, makes sense.

    So what steps the button needs to perform?

    Go thru a list of sheets and check if they already exist? Or just take all Shore Tank sheets and summarize the values?

  29. #29
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    1) Be able to Create a new Set of Tank Template and Gauge Template and rename them to Shore Tank and Gauge Tic.

    2) Eventually have a function in the code that will be able to Rename the Sheets Shore Tank + Value of "F10"
    and Gauge Tic + "G4" value and if more than one Name of Shore Tank + Value of "F10" and Gauge Tic + "G4" exists have it increment the names by 1 so that it will be named... Shore Tank RBOB & Gauge TIC RBOB, then Shore Tank RBOB (2) & Gauge TIC RBOB (2) and so on and so on. This would be best done if there was a button in the summary that you could press first to cycle through the workbook and rename all Shore Tank Sheets and Gauge Tic Sheets to Shore Tank +"F10" and Gauge Tic + "G4" value.

    3) Then be able to have the Summary cycle through the workbook and Tally up the totals of each product.

  30. #30
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Is there a list of sheets available to know how many copies need to be made of the template?

  31. #31
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    There is no predetermined amount of Sheets, hence the reason I made a button to creat a new set each time I needed one.

  32. #32
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by midnightorion View Post
    1) Be able to Create a new Set of Tank Template and Gauge Template and rename them to Shore Tank and Gauge Tic.

    2) Eventually have a function in the code that will be able to Rename the Sheets Shore Tank + Value of "F10"
    and Gauge Tic + "G4" value and if more than one Name of Shore Tank + Value of "F10" and Gauge Tic + "G4" exists have it increment the names by 1 so that it will be named... Shore Tank RBOB & Gauge TIC RBOB, then Shore Tank RBOB (2) & Gauge TIC RBOB (2) and so on and so on. This would be best done if there was a button in the summary that you could press first to cycle through the workbook and rename all Shore Tank Sheets and Gauge Tic Sheets to Shore Tank +"F10" and Gauge Tic + "G4" value.

    3) Then be able to have the Summary cycle through the workbook and Tally up the totals of each product.
    I have worked out the code for point 3 for you though i guess it needs a lil tweaking, right?

    Regarding 1 & 2, you want to create a new sheet for Tank & Gauge but before that the existing list of sheets should be renamed, right?

    I bet this is getting confusing Lets work it out together and we should get some solution.

  33. #33
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by arlu1201 View Post
    I have worked out the code for point 3 for you though i guess it needs a lil tweaking, right?
    Yeah this works fairly ok, but could use some tweaking to make it more efficient. It use to list duplicate products instead of just one product total.

    Regarding 1 & 2, you want to create a new sheet for Tank & Gauge but before that the existing list of sheets should be renamed, right?
    If the sheets could just copy the sheets named Tank Template and Gauge Template at the same time so links stayed linked, and then rename them to Shore tank and Gauge tic at first so the user could fill out the form, then once they fill in the product names on the forms, it could then add the product name to the end of the Sheet name, Shore Tank RBOB and Gauge Tic RBOB, that would be great.

    I bet this is getting confusing Lets work it out together and we should get some solution.
    Nah, would rather ask many questions and try and get it to work the way I would like it to then to just settle and be stuck with something that almost works. ;-)

    Thanks again

  34. #34
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Did you have any luck figureing out what I was trying to do? I see your pretty busy today, guess we are keeping you pretty busy trying to help us all out, much appreciated.

  35. #35
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    If the sheets could just copy the sheets named Tank Template and Gauge Template at the same time so links stayed linked, and then rename them to Shore tank and Gauge tic at first so the user could fill out the form, then once they fill in the product names on the forms, it could then add the product name to the end of the Sheet name, Shore Tank RBOB and Gauge Tic RBOB, that would be great.
    Yes the sheets can be copied and renamed. Should the form-filling be automated or will that be done manually?

  36. #36
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Not sure what you totally sure what you mean by Automated?

    The User will fill out the Cover Page of the Report, which will fill in the Header part of the forms. Then there are going to be multiple areas on each form that the user will have to fill in themselves. Most of the Input will be done on the Gauge Tic which will Feed the Shore Tank Report and then once the user is done filling in that form, they will fill in the empty cells left on the Shore Tank Report, usually just the volumes and roof correction info.

  37. #37
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I guess your last post was all the info i needed to proceed.

    You will need 2 macros for this -

    1. To create a copy of the sheets whenever required and fill in whatever information which can be filled by the macro.
    2. The summary macro which needs to be tweaked.

  38. #38
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by arlu1201 View Post
    I guess your last post was all the info i needed to proceed.

    You will need 2 macros for this - .

    Quote Originally Posted by arlu1201 View Post
    1. To create a copy of the sheets whenever required and fill in whatever information which can be filled by the macro.
    I already created the macro to duplicate the sheets whenever needed. The button is on the Gauge Tic sheet. It duplicates both sheets so the links will remain linked.

    I can't figure out how to Rename the sheets and have them auto increment though? :-(
    So if the user has multiple Shore Tank Reports with the same product, it will increment the Sheet name by 1 each time theres a duplicate.

    example.
    Shore Tank RBOB
    User Creates New Sheet
    Shore Tank RBOB (2)
    User Creates New Sheet
    Shore Tank RBOB (3)
    and so on. This also needs to do the same thing to the Gauge Tic Sheet as well, since they will be linked to each other.


    Quote Originally Posted by arlu1201 View Post
    2. The summary macro which needs to be tweaked.
    Yes this is on the right track. ;-)

  39. #39
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Try this code to rename the sheets. Make the changes to the sheet names as required:
    Please Login or Register  to view this content.

  40. #40
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Using this formula, the links are linked to the Original template, not the copied template? The macro I have created, copies both sheets at the same time, so that the links will update and remain linked to the new Copied sheets.

  41. #41
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I didnt find the original template in your file so i used the one with (2) in the name. You can change it as per your file.

  42. #42
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Here is the code I have made using your code provided. It works as renameing and increment the sheets as I was looking for.
    How would I go about having the sheets Rename again, after the User selects the Product name on the Shore Tank Report?

    This code works perfectly so far, for Copying and Renameing sheets.

    Please Login or Register  to view this content.

  43. #43
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Can you explain to me what you are trying to achieve through this part of your code -
    Please Login or Register  to view this content.
    Is this part of the code required since i have given you my piece?

  44. #44
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    This part of the code Unhides both sheets and then copies both Sheets at the same time, leaving all links intact.

    Quote Originally Posted by arlu1201 View Post
    Is this part of the code required since i have given you my piece?
    I have taken part of what you have given me and what I had already and combined them both to make the code do what I wanted. Only issue I have now, is how to make the Sheet ReName again after a product has been Chosen on the Shore Tank Report and have it increment the names if duplicates are found.
    Last edited by Cutter; 08-23-2012 at 01:23 PM. Reason: Removed whole post quote

  45. #45
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Is there a way to always make a Certain Sheet the last sheet in the book? For instance the Summary of Quantities?

    ---------- Post added at 03:07 PM ---------- Previous post was at 02:58 PM ----------

    Quote Originally Posted by midnightorion View Post
    Is there a way to always make a Certain Sheet the last sheet in the book? For instance the Summary of Quantities?
    CANCEL THIS REQUEST.. Used another part of your code to make it work.

    Please Login or Register  to view this content.

  46. #46
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I have taken part of what you have given me and what I had already and combined them both to make the code do what I wanted. Only issue I have now, is how to make the Sheet ReName again after a product has been Chosen on the Shore Tank Report and have it increment the names if duplicates are found.
    Cant the renaming be done just once? In your case, we are first creating the sheets and renaming them. Again once the product is chosen we are renaming again.

  47. #47
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I don't see a way to Create a Copy of a Blank Template and have it Rename it from "Template Name" to "Shore Tank Product Name (1)" and so on.

    1.) The user has to create the new set of Sheets

    2.) Then select which product from the Template they want to use.

    Unless....Theres a way to have a Message box come up when you press the button to choose which product you would like the new sheets to be for?

    1.) User Presses Button for new sheet

    2.) New Sheet Created and Message Box to Prompt User for which Product they wish to use.

    3.) New Sheet Renamed to "Shore Tank & User Input"

    Is that possible?

    Thanks again.

  48. #48
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Yes, thats possible. Let me work it out for you.

  49. #49
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    That would be great.

    If the Box could automatically populate from the Cover Sheet, from H36 to H41, This is where the user puts the Products to be inventoried to begin with while starting their report, then when they go to create a new sheet and the box pops up asking which Product to use, it could show the products they already provided on the cover. Then when they selected from the box the product Name. The Renaming could take effect just once like you were asking about earlier.

  50. #50
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    If the Box could automatically populate from the Cover Sheet, from H36 to H41, This is where the user puts the Products to be inventoried to begin with while starting their report, then when they go to create a new sheet and the box pops up asking which Product to use, it could show the products they already provided on the cover.
    How would the macro know the products that are already provided on the cover? Will it be shown somewhere?

  51. #51
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by arlu1201 View Post
    How would the macro know the products that are already provided on the cover? Will it be shown somewhere?
    I'm not sure.

    Can the Macro have a set amount of VARIABLES?

    Please Login or Register  to view this content.
    Is this even possible?

    Thank you.

  52. #52
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Bump....Bump

  53. #53
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Oops am sorry. Will work this out for you by tomorrow for sure. Time to hit bed here

  54. #54
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok thanks. Good night.

  55. #55
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    You have any luck on the code?

  56. #56
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    We can have a inputbox that lists all those values up. Then the user selects one out of those and enters them in the space provided which becomes the sheetname.

    Will give you this code now.
    Last edited by arlu1201; 08-23-2012 at 09:15 AM.

  57. #57
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok, cool will give it a shot.
    Any luck on the Summary issue? Listing duplicate names, instead of tallying up the total of duplicates?

  58. #58
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Try this for the sheet names -
    Please Login or Register  to view this content.

  59. #59
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Red face Re: Macro/Code to Go Through Workbook and Build a Summary

    User prompt works great, is there a way to use Radio buttons instead of typing in a response? If not, no big deal.

    This is the code after I got done with it.

    Please Login or Register  to view this content.

    I think once we get the duplicating issue squared away, I should be all set. Again I appreaciate your time and patience for helping me out.

  60. #60
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    If you need option buttons, you will have to create a userform for that.

    So the issue to create sheets is done right?

    Can you give me a lil background on the duplicate issue so i dont have to read through all the posts of this thread?

  61. #61
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    For the Summary, you created the macro that will populate the Fields with the information from each Shore Tank. But if there is more than one shore tank with the same Product name, instead of just totaling up the VALUE, it shows as another product on the Summary Sheet.

    Example. (AS it is now)

    TABS=(Shore Tank RBOB) , (Shore Tank RBOB 2), (Shore Tank RBOB 3) , (Shore Tank RBOB 4)

    Summary READS:

    RBOB 5
    RBOB 10
    RBOB 15
    RBOB 20

    Instead is should READ:

    TABS=(Shore Tank RBOB) , (Shore Tank RBOB 2), (Shore Tank RBOB 3) , (Shore Tank RBOB 4)

    RBOB 50

    I would like to have the Summary sheet be able to give me totals of each product.


    Please Login or Register  to view this content.


    ---------- Post added at 10:59 AM ---------- Previous post was at 10:56 AM ----------

    Quote Originally Posted by arlu1201 View Post
    If you need option buttons, you will have to create a userform for that.
    I will have to play with that and figure out how to do it, haven't got a clue.

    So the issue to create sheets is done right?
    YES ;-)
    Last edited by midnightorion; 08-23-2012 at 02:02 PM.

  62. #62
    Registered User
    Join Date
    08-23-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I am trying to take multiple Excel workbooks and merge them into one for summary purposes. What code is best for this? I have tried several and failed. Please help?

  63. #63
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Hello sbastin, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following and make the necessary change. Thanks.

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

  64. #64
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Bump Bump Bump

  65. #65
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    bump bump bump bump

  66. #66
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Arlu,

    The code to rename the sheets based on user input works great, I was just wondering how I would go about NAMEING a CELL based on the same user input?

    Cell $F$10= (" & userreply & ") On the Shore Tank Sheet.

    Thanks,
    Last edited by midnightorion; 09-13-2012 at 08:35 AM.

  67. #67
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Try
    Please Login or Register  to view this content.

  68. #68
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I must be putting the code in the wrong place or something..

    A little Help Please...Where should it be placed?

    Please Login or Register  to view this content.

  69. #69
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Put it below this line
    Please Login or Register  to view this content.
    There are 2 instances of the line in the code, so put it after each.

  70. #70
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    You have any luck on the taking care of the duplicating Name and Totals in the Summary?

  71. #71
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Working on that. Did the solution in post 69 help you?

  72. #72
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by arlu1201 View Post
    Working on that. Did the solution in post 69 help you?
    Yes, worked Great and applied it a little further. Thank you much.

    Please Login or Register  to view this content.

  73. #73
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    How are you making out with that?

  74. #74
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Do you have a latest file which has the sheets created? I was facing some issues working with your file in post 27.

  75. #75
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Sure, give me a couple minutes.

  76. #76
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Attachment 181221 Here is the latest Blank so far.

  77. #77
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I was talking about the file having the sheets already created with the values put in, so that i could work on correcting the summary tab. Will you be able to upload that?

  78. #78
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Just goto the index tab and click on add tab a couple times. Or do you want me to add Values to the Sheets? I will do that while waiting for your response.

  79. #79
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Yes, so that both you and i can verify that the macro is working fine, once i correct it.

  80. #80
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Ok cool almost done. Give me about 5 more minutes to plug in all the numbers.

  81. #81
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Attachment 181226 Here is a sample form.

  82. #82
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I am trying to figure out how to do a count of a Specific set of Work Sheets?

    Please Login or Register  to view this content.
    I understand that the Range will paste the Count of Work Sheets. But if I add "Like "Shore Tank" after like I did above, it just returns "False" as the value instead of a Count of work sheets with the name Shore Tank? What am I doing wrong?

  83. #83
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Quote Originally Posted by midnightorion View Post
    I am trying to figure out how to do a count of a Specific set of Work Sheets?

    Please Login or Register  to view this content.
    I understand that the Range will paste the Count of Work Sheets. But if I add "Like "Shore Tank" after like I did above, it just returns "False" as the value instead of a Count of work sheets with the name Shore Tank? What am I doing wrong?
    You cannot do it that way. You will need to use a loop where it goes to each sheet and checks the name and increments the count.
    Like this
    Please Login or Register  to view this content.

  84. #84
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    There are merged cells in the Summary tab, which are affecting the sorting. Is it possible not to have the merged cells?

  85. #85
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Sure, just use AC:AE and we can then link the values into the summary tab.

    That should work?

    Please Login or Register  to view this content.

  86. #86
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Yes, and we can then have the macro pull in those values if you wish.

  87. #87
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Yes, and we can then have the macro pull in those values if you wish.
    Yeah, that would work fine I suppose. Lets try that and see. ;-)


    Quote Originally Posted by arlu1201 View Post
    You cannot do it that way. You will need to use a loop where it goes to each sheet and checks the name and increments the count.
    Like this
    Please Login or Register  to view this content.
    Using that code, how do I make it Paste the Value into a Cell I want? Like Cell "I10" ?

  88. #88
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Using that code, how do I make it Paste the Value into a Cell I want? Like Cell "I10" ?
    You want the count to be populated? In which sheet?

  89. #89
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Index Sheet. Cell "F2"

    Would be nice to be able to see how many Visible Sheets of a particular kind existed in the workbook.

  90. #90
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    This is the code
    Please Login or Register  to view this content.
    Would be nice to be able to see how many Visible Sheets of a particular kind existed in the workbook.
    You mean a count of all RBOB, PBOB sheets,etc?

  91. #91
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Nope, what you did there was perfect. Just an overall count of a set of Sheets created.

    Thanks.

  92. #92
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    This is your code for the summary. Had a problem with the sorting, so it took some time.
    Please Login or Register  to view this content.

  93. #93
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I tried the code. If I copy a bunch of sheets, just to increase the number of Shore Tanks. It doubles up the Summary Again.

  94. #94
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    The macro will clear the summary page and restart, so it cant be doubling. Let me try it at my end.

  95. #95
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    To test your issue, i clicked on the Add button and created the sheets. Then i edited B61 & B60 in the new shore tank sheets. And just made a copy of the gauge tick sheet values. But those values are not showing up in the summary. Maybe i am updating the wrong sections.

    To speed it up, why dont you upload your file after adding in the extra sheets and i can troubleshoot the summary code?

  96. #96
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Will try. Sometime the file size limit gets in the way.

  97. #97
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Attachment 181304 Try this one. Just need to add the Code to the Module. I was trying a different tactic to see if I could get it to work another way for now.

  98. #98
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I tried the code in the sheet and its showing up the same values as the previous sample file. Did you add in extra sheets?

  99. #99
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    I am trying to add more Sheet, but the file becomes too large for the forums.

    If you just copy, both the gauge tic and shore tank at the same time, and then Hit the Update Summary button, thats when I got the duplicate errors again.

  100. #100
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    You can zip the file if its too huge. But let me try what you said.

  101. #101
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Updated code -
    Please Login or Register  to view this content.

  102. #102
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    That seems to have done the trick....


    Thank you very much.

  103. #103
    Forum Contributor
    Join Date
    07-12-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Macro/Code to Go Through Workbook and Build a Summary

    Solved!!!!

    Give this man a COOKIE!!!

    Excellent work.

  104. #104
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro/Code to Go Through Workbook and Build a Summary

    @ midnightorion

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ 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