+ Reply to Thread
Results 1 to 4 of 4

Macro for Opening and copying data to another workbook with password

  1. #1
    Forum Contributor
    Join Date
    12-04-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    127

    Macro for Opening and copying data to another workbook with password

    Hello,

    I was wondering if someone could help me / give advice on a macro I need.

    I'm guessing what I want to achieve should be quite simple.

    I have a blank form (workbook1). Sales fill in the form, and email it to me for logging and circulation.

    I then manually input the data onto a spreadsheet (workbook2) and email company wide. I want to slowly automate this whole process or at least make it easier for me as Im getting about 20 - 30 of these forms aday.

    So,

    I have workbook 1.
    Cells E13 , B7, D19 & B2 have the information I want to copy.

    Workbook 2 is password protected.
    I want to copy the above data to this workbook into column A, B, C & D all on the same row.

    Save.

    Then when I run the macro again, say the next day on a new / different workbook, I want to copy to workbook 2 again, but in the next empty row.

    The macro will be a button which is embedded in the blank template (workbook1)

    Can anyone help?

    Help much appreciated!


    Thanks


    Michael

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Macro for Opening and copying data to another workbook with password

    Try this out, make sure the WorkBook is in a folder that matches the code.

    OriginalWorkBook is the workbook that has the data to send to the GetNewData workbook.

    I have tested it many times and have not received an error.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro for Opening and copying data to another workbook with password

    Hello Michael,

    This is a little different than Dave's. This macro uses the Open Dialog to let you pick the Excel file to open. The sheet copied to is "Sheet1" you can change this to match you sheet name. Currently, the sheet is protected without a password. You can add one to the variable PWD. Both are marked in blue.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    09-05-2013
    Location
    London, england
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro for Opening and copying data to another workbook with password

    Thanks guys. I used a variation of this code to suit my purposes.

+ 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