Consulting

Results 1 to 2 of 2

Thread: Solved: Save as Filename with a variable text

  1. #1
    VBAX Regular
    Joined
    Jun 2008
    Posts
    52
    Location

    Solved: Save as Filename with a variable text

    Hi,

    I have a spreadsheet with SQL retreived data, pivots and calculations in it which will be used of weekly and/or monthly base.

    Now the question is that I want to have a macro where the file is being saved like "TestFile_[MMMYYYY].xls to a different location then where this sheet is opened from.
    Now, the "MMMYYY" can be copied from a cell in that sheet. It should contain the monthNAME and not the monthnumber.

    Can sombody help me with the code?


    Thanx in advance and kind regards,

    Riaaz66

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Activeworkbook.Saveas "C:\some dir\TestFile_" & Range("A1").Value & ".xls"
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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