Consulting

Results 1 to 2 of 2

Thread: Solved: Where can I find a script that will copy the activesheet

  1. #1
    VBAX Regular Erays's Avatar
    Joined
    Mar 2005
    Posts
    73
    Location

    Solved: Where can I find a script that will copy the activesheet

    Where can I find a script that will copy the activesheet and name it from data entered in a cell and save it to a folder of my choice?

  2. #2
    VBAX Tutor
    Joined
    May 2004
    Location
    Germany, Dresden
    Posts
    217
    Location
    This might do it:

    [VBA]

    Sub MyCopySheet()
    Dim sPath$, sName$

    'Change this, don't forget the trailing \
    sPath = "e:\test\"

    'Cell with the name is A1 on active sheet, change this
    sName = ActiveSheet.Range("A1").Value

    ActiveSheet.Copy
    ActiveSheet.SaveAs sPath & sName
    End Sub

    [/VBA]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •