Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Feb 2015
    Posts
    128
    Thanks
    19
    Thanked 1 Time in 1 Post

    Post Rename the sheet with cell value.

    Hi Experts

    Could you please help me to amend the below code to rename the sheet with the cell value "A1" and then save it.

    Code:
    ActiveWorkbook.SaveAs Filename:="C:\Users\Sinderjt\Desktop\New folder (12)\Risk Score Result.xlsx"

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Jaggi,

    Do you want to rename the sheet tab as well as the filename?

    Does A1 contain just the filename or the filename.ext?

    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    2 Star Lounger
    Join Date
    Feb 2015
    Posts
    128
    Thanks
    19
    Thanked 1 Time in 1 Post
    Hi RG

    I do not want to rename the sheet tab. I want to rename the sheet only.

    Actually Row 1 is a merged cell from (A1:M1) and the name of the file is in it.

    Regards,
    JD

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Jaggi,

    This should do it unless the merged cell has an effect I'm unaware of:
    ActiveWorkbook.SaveAs Filename:="C:\Users\Sinderjt\Desktop\New folder (12)\" & [A1] & ".xlsx"

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. The Following User Says Thank You to RetiredGeek For This Useful Post:

    Jaggi (2015-06-04)

  6. #5
    2 Star Lounger
    Join Date
    Feb 2015
    Posts
    128
    Thanks
    19
    Thanked 1 Time in 1 Post
    Hi RG

    It worked like a charm! I spend my entire day yesterday to try to find the solution for this. Thanks Mr Geek.

    Regards,
    JD

  7. #6
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Jaggi,

    Gald to be of assistance.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

Tags for this Thread

Posting Permissions

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