+ Reply to Thread
Results 1 to 6 of 6

Macro to save data in sheet to file on hard drive.

  1. #1
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Macro to save data in sheet to file on hard drive.

    Hello

    I was wondering if anybody could help please.

    I have a workbook in which i would like to save one sheet from my workbook into a file on the harddrive.

    Unfortunately the data is confidential so i cannot get my existing workbook off my computer .

    How i would like it to function is for each person to save their work according to who their boss is. So i need a drop down menu that displays all the bosses name.
    Mike, dave and Julie
    The person will do their work which will generate data on sheet2

    i would like them to then select who their boss is with a dropdown menu and then their data to be sent to a file C:/WSA Project/ - name of boss -

    So the choice of name automatically changes the folder destination.

    If possible i would also like it to flash up a message if they have not chosen their bosses name.

    I intend to add all this already to a button that activates other commands as well.

    Is all this possible?

    Hopefully somebody could help, and if anybody requires any further questions please ask, and once again sorry for not being able to attach my workbook.

    Kind regards

    Joe
    Last edited by sandbach; 10-26-2010 at 03:55 PM.

  2. #2
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to save data in sheet to file on hard drive.

    Further to that the drop down menu with bosses names is located in cell a4 on sheet1, data is on sheet2

  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 to save data in sheet to file on hard drive.

    Hello sandbach,
    1. Is this drop down a Data Validation type?
    2. If you want the drop down on Sheet1 in cell A4, do you have a range somewhere that holds the names?
    3. Does this range have a name?
    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-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to save data in sheet to file on hard drive.

    Hello Leith

    I have actually just managed to solve the drop down bit so i just need the file saving macro bit dependant on what value is held in a4 for the last part of the file path.

    I had tried for ages trying to work it out msyelf the drop down bit and finally had a break through, i just cant crack the macroy bit!

    Kind regards

    Joe

  5. #5
    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 to save data in sheet to file on hard drive.

    Hello Joe,

    This macro will check that the Boss' name has been selected before the file can be saved. If a name has not been chosen then a message notifies the user and automatically selects cell A4 on Sheet1.
    Please Login or Register  to view this content.

    How to Save a Workbook Event Macro
    1. Copy the macro using CTRL+C keys.
    2. Open your Workbook and Right Click on any Worksheet's Name Tab
    3. Left Click on View Code in the pop up menu.
    4. Press ALT+F11 keys to open the Visual Basic Editor.
    5. Press CTRL+R keys to shift the focus to the Project Explorer Window
    6. Press the Down Arrow Key until ThisWorkbook is highlighted in blue.
    7. Press the Enter key to move the cursor to the Code Window
    8. Paste the macro code using CTRL+V
    9. Save the macro in your Workbook using CTRL+S
    Last edited by Leith Ross; 10-25-2010 at 12:33 PM.

  6. #6
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to save data in sheet to file on hard drive.

    Thanks Leith

    That is fantastic!!

    Ive used the code and adapted it a bit but just the ticket!!!

    Thanks again.

+ 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