+ Reply to Thread
Results 1 to 16 of 16

Summary Sheet Macro

  1. #1
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Summary Sheet Macro

    Hi,

    I am really new to this but have had a go and I am really struggling.

    I need to create a Summary sheet that looks up values from the files within the folder.

    The files in the folder are all exactly the same I just need to select certain values.

    I would like to create a summary sheet with standard headings etc and the run the Macro and this would then be populated from the all the files within the folder.

    Is this possible?

    Any help would be greatly appreciated.

    Thanks
    Christian

  2. #2
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Summary Sheet Macro

    Hi and welcome!
    Copy this code in Module, change red parameters: path to the folder with your files and Range you want to copy from all workbooks.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Re: Summary Sheet Macro

    Hi Thanks for the response,

    I am struggling to update the range. I need "O44:Q44" , "X49: Z84" and "X84:Z84"

    How would I include this?

    Thanks again

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Summary Sheet Macro

    Why not attach a workbook showing the desired results and where you want the values to appear. It is not clear how you would wish to group the ranges as they are different lengths

    Regards

    Dav

  5. #5
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Re: Summary Sheet Macro

    Hi,

    I have attached both an example of what the summary sheet would look like and the file I am trying to summarise.

    Thanks
    Christian

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Summary Sheet Macro

    Perhaps something along the lines of

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Re: Summary Sheet Macro

    Thanks for that.

    I've updated but it is not producing anything? I press the run button but nothing happens?
    Thanks again

  8. #8
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Summary Sheet Macro

    Did you change this one in your code?
    Please Login or Register  to view this content.
    And your files are .xlsx or .xls?
    Last edited by kasan; 12-05-2016 at 01:11 PM.

  9. #9
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Re: Summary Sheet Macro

    Yeah, I changed it to the place with all the files in.

    "C:\Users\xxxx\Desktop\New folder"

    Thanks

  10. #10
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Summary Sheet Macro

    It should be "C:\Users\xxxx\Desktop\New folder\"

  11. #11
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Re: Summary Sheet Macro

    It's working and outputs the information from only one file.

    Then it runs into a runtime error:'1004' Application -defined or object-defined error.

    I debug it and the following line is highlighted:
    wbkNew.Sheets("summary").Range("a" & NR & ":a" & endrow).Value = ThisWorkbook

    The file I am pulling the information from also loads with a couple of blue lines on.

    Thanks
    Christian

  12. #12
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Summary Sheet Macro

    Remove this strange line:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Re: Summary Sheet Macro

    Thanks Kasan and everyone for helping!

    It works now. I think I follow the code as well so I am going to add in a few more lines and it should be a great tool for me!

    Thanks again!

    Christian

  14. #14
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Summary Sheet Macro

    Great! Good luck

  15. #15
    Registered User
    Join Date
    12-05-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    14

    Re: Summary Sheet Macro

    I am now trying to set the program to take the current directory, but it is not recognizing the "\" just before the .xlsb

    Set wbkNew = ThisWorkbook
    strPath = ActiveWorkbook.Path 'folder with all files
    strFileName = Dir(strPath & "\*.xlsb")

  16. #16
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: Summary Sheet Macro

    Try this:
    Please Login or Register  to view this content.
    p.s. not a good idea to run this macro from file which is in the same folder as all other files. Code will try to open your current file as well.
    If you need to loop throw several folders then better solution would be call Folder Dialog window where you could choose folder with files.
    Last edited by kasan; 12-06-2016 at 05:52 AM.

+ 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. Want to create a summary sheet with variable number of worksheets in a file
    By alw99 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2014, 11:44 PM
  2. [SOLVED] Need a macro to create a summary sheet
    By rgeorge in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 02-07-2014, 12:26 PM
  3. From Report sheet to summary to CSV macro
    By jjislas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2013, 12:39 PM
  4. [SOLVED] Summary sheet - copy cell contents from multiple sheets to one summary sheet
    By jsmity in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 10:32 AM
  5. [SOLVED] Repeated action - shorten macro - copy from each sheet to summary sheet
    By sans in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-07-2012, 11:37 AM
  6. How to write macro to add summary from multiple sheet to final sheet
    By Santoshmoni in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2011, 09:08 AM
  7. A macro to make a summary sheet
    By ADK in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-06-2005, 04:05 PM

Tags for this Thread

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