+ Reply to Thread
Results 1 to 4 of 4

Macro Code to Add Password to Spreadsheet

  1. #1
    Registered User
    Join Date
    02-03-2014
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Macro Code to Add Password to Spreadsheet

    Hi,

    I have the VBA code which runs and splits a master spreadsheet into multiple files based on a value of a given cell.

    We are trying to add a password to the subsequent created files.

    Is there any VBA code which can assist with this query.

    Regards

    Phil

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro Code to Add Password to Spreadsheet

    The SaveAS command in VBA allows you to add a "Password:="MyPassword" parameter.

    If you have trouble adding that or Googling examples to make the edit obvious, post your code and we'll offer something more exact.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-03-2014
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Macro Code to Add Password to Spreadsheet

    Hi,

    Many thanks for your help.

    I worked out the password code from another source. I am now having issues with ensuring the formulas from the master sheet are copied into the subsequent split sheets.

    There is a code line which reads "ActiveSheet.Cells(2, 2).Value" which is the only reference I can see to possibly pasting the values of the master sheet.

    Please can you advsie if there is any code which will ensure the formulas kept. The cell range of the sheet is A to AF.

    Regards

    Phil

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro Code to Add Password to Spreadsheet

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    New questions... new threads with appropriate titles.
    Thanks.

+ 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. Excel Spreadsheet/Macro/Password Issue
    By davidlwoolard in forum Excel General
    Replies: 1
    Last Post: 04-19-2012, 03:38 PM
  2. [SOLVED] How to see macro code of a password protected macro without a password?
    By Dmitry Kopnichev in forum Excel General
    Replies: 5
    Last Post: 10-27-2005, 05:05 AM
  3. [SOLVED] How to see macro code of a password protected macro without a password?
    By Dmitry Kopnichev in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2005, 05:05 AM
  4. [SOLVED] How to see macro code of a password protected macro without a password?
    By Dmitry Kopnichev in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-27-2005, 05:05 AM
  5. Replies: 1
    Last Post: 02-08-2005, 06:06 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