+ Reply to Thread
Results 1 to 5 of 5

Thread: How to save a single worksheet as worksheet name in new folder??

  1. #1
    Forum Guru Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,023

    How to save a single worksheet as worksheet name in new folder??

    Hi all,

    Can anyone tell me how in vba to save a single worksheet as the worksheets name in a new folder called statistics on the desktop or in my documents but if the folder does not exist create it first?

    Rather than save all my statistic worksheets in the workbook they were generated in i would like to save them as a read only worksheet in another folder, this way people can view or copy from an area where they can have no direct influence on the workbook that created them.

    Any ideas?

    Regards,

    Simon

  2. #2
    Bob Phillips
    Guest

    Re: How to save a single worksheet as worksheet name in new folder??

    ActiveSheet.Copy
    On Error Resume Next
    MkDir "C:\Documents and Settings\bob\Desktop\statistics"
    On Error GoTo 0
    ActiveWorkbook.SaveAs "C:\Documents and
    Settings\bob\Desktop\statistics\" & ActiveSheet.Name

    change the location to suit

    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "Simon Lloyd" <Simon.Lloyd.27whca_1147782901.6981@excelforum-nospam.com>
    wrote in message
    news:Simon.Lloyd.27whca_1147782901.6981@excelforum-nospam.com...
    >
    > Hi all,
    >
    > Can anyone tell me how in vba to save a single worksheet as the
    > worksheets name in a new folder called statistics on the desktop or in
    > my documents but if the folder does not exist create it first?
    >
    > Rather than save all my statistic worksheets in the workbook they were
    > generated in i would like to save them as a read only worksheet in
    > another folder, this way people can view or copy from an area where
    > they can have no direct influence on the workbook that created them.
    >
    > Any ideas?
    >
    > Regards,
    >
    > Simon
    >
    >
    > --
    > Simon Lloyd
    > ------------------------------------------------------------------------
    > Simon Lloyd's Profile:

    http://www.excelforum.com/member.php...fo&userid=6708
    > View this thread: http://www.excelforum.com/showthread...hreadid=542456
    >




  3. #3
    Forum Guru Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,023
    Thanks for the speedy reply bob, is there any way that the statements you provided can work on all machines i.e if it was a network machine just put it on the desktop or if it was a personal computer with a couple of users just put it on that users desktop?

    Many thanks,


    Simon

  4. #4
    Tom Ogilvy
    Guest

    RE: How to save a single worksheet as worksheet name in new folder??

    on Error Resume Next
    Mkdir "M:\Statistics"
    On Error goto 0
    Activesheet.copy
    sName = "M:\Statistics\" & _
    Activesheet.Name & ".xls"
    Activeworkbook.SaveAs sName , xlWorkbook.Normal, _
    ReadOnlyRecommended:=True
    Activeworkbook.Close SaveChanges:=False

    --
    Regards,
    Tom Ogilvy


    "Simon Lloyd" wrote:

    >
    > Hi all,
    >
    > Can anyone tell me how in vba to save a single worksheet as the
    > worksheets name in a new folder called statistics on the desktop or in
    > my documents but if the folder does not exist create it first?
    >
    > Rather than save all my statistic worksheets in the workbook they were
    > generated in i would like to save them as a read only worksheet in
    > another folder, this way people can view or copy from an area where
    > they can have no direct influence on the workbook that created them.
    >
    > Any ideas?
    >
    > Regards,
    >
    > Simon
    >
    >
    > --
    > Simon Lloyd
    > ------------------------------------------------------------------------
    > Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
    > View this thread: http://www.excelforum.com/showthread...hreadid=542456
    >
    >


  5. #5
    Bob Phillips
    Guest

    Re: How to save a single worksheet as worksheet name in new folder??

    You should create an add-in, and then load that add-in on all machines.

    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "Simon Lloyd" <Simon.Lloyd.27wii0_1147784404.973@excelforum-nospam.com>
    wrote in message
    news:Simon.Lloyd.27wii0_1147784404.973@excelforum-nospam.com...
    >
    > Thanks for the speedy reply bob, is there any way that the statements
    > you provided can work on all machines i.e if it was a network machine
    > just put it on the desktop or if it was a personal computer with a
    > couple of users just put it on that users desktop?
    >
    > Many thanks,
    >
    >
    > Simon
    >
    >
    > --
    > Simon Lloyd
    > ------------------------------------------------------------------------
    > Simon Lloyd's Profile:

    http://www.excelforum.com/member.php...fo&userid=6708
    > View this thread: http://www.excelforum.com/showthread...hreadid=542456
    >




+ 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.2.0