+ Reply to Thread
Results 1 to 10 of 10

Macros to save worksheet based on cell reference

  1. #1
    Forum Contributor
    Join Date
    07-07-2008
    Location
    sCOTLAND
    MS-Off Ver
    Office 2003 SP3
    Posts
    256

    Macros to save worksheet based on cell reference

    Hi

    Could someone please help me with this? I have a macros ( code inserted ) as you can see in my code the macros save the workbook in any file name you chose just by changing the any filename option.

    I would like this to be changed so that it saves based on a cell reference, say i has a name in lets say B10 i would like it to save as the name in B10.
    Last edited by JimmiOO; 02-13-2009 at 01:26 PM.

  2. #2
    Forum Contributor
    Join Date
    07-07-2008
    Location
    sCOTLAND
    MS-Off Ver
    Office 2003 SP3
    Posts
    256

    Re: Macros to save worksheet based on cell reference

    I managed to get this sorted but i am still having a problem with my sheet, when the macros saves it, it is not saving exactly the way the sheet is before its saved. My page breaks do not keep the original setting and some of the cells save smaller than they were originally. Is there anyway to fix this?

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macros to save worksheet based on cell reference

    Consider using SaveCopyAs

    Please Login or Register  to view this content.
    You would be best to indicate the sheet as well as the range
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    07-07-2008
    Location
    sCOTLAND
    MS-Off Ver
    Office 2003 SP3
    Posts
    256

    Re: Macros to save worksheet based on cell reference

    Hi Roy thanks for the reply

    I forgot to insert the code after i fixed the first problem

    the code is below, the B10 is a cell referece the sheet saves as. Its all works well now but when i open the saved sheet all the page breaks are messed up and a couple of colums have got smaller. I would like it to save exactly like the original sheet if possible


    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-07-2008
    Location
    sCOTLAND
    MS-Off Ver
    Office 2003 SP3
    Posts
    256

    Re: Macros to save worksheet based on cell reference

    I have noticed that after the macros saves the file to my destination folder, it not only does not save my original page breaks it also sets my colums to the same width. Example, i have Column A set at 4.5 Column B set at 15 Column C 4.83 etc, once it is saved it sets all the columns to 8.43, This is messing my sheet up, can it be fixed?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macros to save worksheet based on cell reference

    Can you attach an example workbook?

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macros to save worksheet based on cell reference

    x-post

    http://www.mrexcel.com/forum/showthread.php?t=370796

    Per forum rules please ensure you post links to any x-posts you make.

  8. #8
    Forum Contributor
    Join Date
    07-07-2008
    Location
    sCOTLAND
    MS-Off Ver
    Office 2003 SP3
    Posts
    256

    Re: Macros to save worksheet based on cell reference

    Quote Originally Posted by royUK View Post
    Can you attach an example workbook?

    Hi Roy


    I have inserted a sample of my sheet, as you will see the page break and the colums are set, once it is saved it all changes


    Make a folder in your c: drive called files before you save the file


    DonkeyOte sorry about not putting the link to the other post
    Last edited by JimmiOO; 02-13-2009 at 01:26 PM.

  9. #9
    Forum Contributor
    Join Date
    07-07-2008
    Location
    sCOTLAND
    MS-Off Ver
    Office 2003 SP3
    Posts
    256

    Re: Macros to save worksheet based on cell reference

    Thanks for all your help problem solved

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macros to save worksheet based on cell reference

    Try this way
    Please Login or Register  to view this content.

+ 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