+ Reply to Thread
Results 1 to 4 of 4

Need Macro modification to run & do its job in Specified Sheet

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    Sialkot, Pakistan
    MS-Off Ver
    2007
    Posts
    20

    Need Macro modification to run & do its job in Specified Sheet

    Hello friends,

    I am struggling with a code to run on specific worksheet in a workbook. Basically the Macro loops through multiple excel files in a folder, searches a worksheet named 'Summary' in each file & merges them by copying / pasting in Master workbook I run the code from. I have folders like CLASS1, CLASS2, CLASS3 having various workbooks. In the workbook which contains the code (which I got from http://www.excelforum.com/excel-prog...e-heading.html) I have worksheets named CLASS1, CLASS2 & CLASS3. The code I use for individual folders are:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    I want the contents of Summary sheets from CLASS1 folder in Sheet named the same in Master Workbook. Help with some code modification will be greatly appreciated. Kindly also tell me If time stamp can be inserted in Cell A1 after the code has done its job.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Need Macro modification to run & do its job in Specified Sheet

    So if I understands you right you have a main folder and then you have 3 subfolders named Class1, Class2 and Class3 but every file in thes 3 classes has a worksheet named "Summary"

    You wish for a macro that loops through every subfolder extracting the data from each "Summary" and for subfolder. Class1 result should be placed in "Master" workbook in worksheet Class1 and result from Class2 subfolder should be placed in worksheet Class2 and so forth. Is that right?

    By the way your sPath is missing a "\", sPaht without the last backslach will stop the macro from running.

    Please Login or Register  to view this content.
    Alf

  3. #3
    Registered User
    Join Date
    02-09-2015
    Location
    Sialkot, Pakistan
    MS-Off Ver
    2007
    Posts
    20

    Re: Need Macro modification to run & do its job in Specified Sheet

    Hello Alf,

    You are absolutely right. The code works fine but it doesn't have instructions to paste data in the right sheet & being a novice I have no idea what to edit in the macro..

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Need Macro modification to run & do its job in Specified Sheet

    This macro loops throug all your three folders, "E:\Data\CLASS1", "E:\Data\CLASS2" and "E:\Data\CLASS3". The data in each "Summary" sheet is pasted to "Master" file sheet "CLASS1" for all files in subfolder "CLASS1", and sheet "CLASS2" for all files in subfolder "CLASS2" and finaly to sheet "CLASS3" for all files in subfolder "CLASS3"

    Please Login or Register  to view this content.
    Alf

+ 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. Replies: 6
    Last Post: 11-05-2013, 02:22 AM
  2. Save date in cell on sheet modification
    By Onesock in forum Excel General
    Replies: 28
    Last Post: 11-21-2012, 06:00 PM
  3. Macro Modification
    By johncena in forum Excel General
    Replies: 0
    Last Post: 02-17-2010, 10:40 AM
  4. need help with macro modification please
    By excelguru in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-14-2005, 03:18 PM
  5. Macro modification
    By Hirsch in forum Excel General
    Replies: 3
    Last Post: 05-27-2005, 06:05 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