+ Reply to Thread
Results 1 to 10 of 10

Copying Data from Multiple Protected Workbooks into Master

  1. #1
    Registered User
    Join Date
    05-16-2018
    Location
    Buffalo, NY
    MS-Off Ver
    2010
    Posts
    4

    Copying Data from Multiple Protected Workbooks into Master

    Hi Everybody,

    Any ideas on the following:

    I need to copy data from multiple cells from different protected workbooks in different folders and paste it into a master workbook. (Open workbook -> unprotect workbook -> copy from desired cells -> paste into master in desired cell locations -> reprotect workbook -> close workbook). Please see the attached workbook for how I want to see the master workbook formatted.

    I appreciate any help or guidance for this task!
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Copying Data from Multiple Protected Workbooks into Master

    This is the way I am interpreting this requirement.

    You open a workbook, get a piece of data and put in in a specific cell. Then you open the next workbook, get the same piece of data and put it in the cell underneath the one you just got.

    I have several questions: Are the books in question in the same directory and are they the only books in the directory - or do you know the name of each book?
    Will each book be set up so that I always go to Cell A4 (for example) and always put that in Cell C1 and for the next book, put the same piece of information in Cell C2. etc.?

    You probably won't have to protect, unprotect the workbook if you are only reading data from it. Simply close the workbook without saving and it will stay protected.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    05-16-2018
    Location
    Buffalo, NY
    MS-Off Ver
    2010
    Posts
    4

    Re: Copying Data from Multiple Protected Workbooks into Master

    1. Yes, all the workbooks are stored under the same main directory, but organized into multiple sub directories. However, I do not know the name of each book in the directories, but will be taking data from all the workbooks in that main directory.
    2. Yes, the cell locations for the desired data should be in the same location each time except one row of data that may change location. The only way to identify that variable row location is by a number keyword in that row.

    Thanks for the help!

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Copying Data from Multiple Protected Workbooks into Master

    We'll need to know a couple more things:
    1. The directory structure
    2. A couple of samples of what the source workbooks look like.
    3. A sample, mocked-up workbook of what the desired result would look like based on the sample input.

    VBA can go to a directory and process all the files of whatever type you specify. We don't need to know the names of the files. However, we do have to know the names of the directories. Also, I recommend that for each directory, you have a sub-directory named Processed. After a file is processed it will be moved there so it does not get processed the next time the program is run.

  5. #5
    Registered User
    Join Date
    05-16-2018
    Location
    Buffalo, NY
    MS-Off Ver
    2010
    Posts
    4

    Re: Copying Data from Multiple Protected Workbooks into Master

    1. I will be copying all the workbooks that need to be processed into a separate folder on my desktop.
    2. Please see attached
    3. Please see attached
    Attached Files Attached Files

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Copying Data from Multiple Protected Workbooks into Master

    I have a couple more questions: Will Machine, Serial, and Date always be in cells A1, C3 and G4, respectively - I will press on as if they are.

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Copying Data from Multiple Protected Workbooks into Master

    Is there a password on the workbooks?

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Copying Data from Multiple Protected Workbooks into Master

    I think this does what you want it to do. It does not matter if the workbooks are protected. All the program does is read data. It does not try to change the workbook nor does it even try to save it.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-16-2018
    Location
    Buffalo, NY
    MS-Off Ver
    2010
    Posts
    4

    Re: Copying Data from Multiple Protected Workbooks into Master

    Yes, the workbook seems to move the files without any problems. However, it does not copy and paste any of the data. The password is password.

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Copying Data from Multiple Protected Workbooks into Master

    I can't duplicate the issue. It copies the cells OK. This might be one of those wonderful compatibility issues between versions of Excel.

    I'm using Excel 2016 - when I click on Protect Workbook, and enter and confirm the password, the icon still reads "Protect Workbook." There is no indication that it is already protected. I was expecting the icon to change to "Unprotect Workbook."

    But when I click on "Protect Workbook" I get the prompt to enter the password to "Unprotect Workbook"

    The only suggestion I can make is to double check that you have the files in the pickup directory and that the proper cells are populated. Attached is what I used as my "fodder" for testing.
    Attached Files Attached Files

+ 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. Help with copying data from cells in multiple workbooks to a master workbook
    By jamesh4ll in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2014, 05:28 PM
  2. Copying data from multiple workbooks having multiple sheets into one master worksheet
    By Navya Ahuja in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2014, 09:42 AM
  3. Copying data from multiple workbooks to 1 master workbook
    By chilli76 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2014, 12:50 PM
  4. Replies: 1
    Last Post: 11-21-2012, 11:23 AM
  5. Macro- Copying Multiple Workbooks into Master
    By eric.cappelli in forum Excel General
    Replies: 1
    Last Post: 05-13-2009, 07:37 AM
  6. Macro- Copying Multiple Workbooks into Master
    By eric.cappelli in forum Excel General
    Replies: 0
    Last Post: 05-11-2009, 05:32 AM
  7. Macro-copying multiple workbooks into master
    By eric.cappelli in forum Excel General
    Replies: 0
    Last Post: 05-08-2009, 08:12 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