+ Reply to Thread
Results 1 to 5 of 5

Changing Cell Value format as desired while saving the file in the current directory

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Changing Cell Value format as desired while saving the file in the current directory

    Hi all,

    I am using below code to save the active workbook in the current directory using cell value C74 as the name of the workbook.
    ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & wb.Sheets("Control").Range("C74").Value, xlWorkbookNormal
    Value in C74 is stored in the format dd-mm-yyyy.While saving the file name it is saving as dd-mm-yyyy but I would like to save the file name in the format "MMM YYYY" .

    Any help will be appreciated.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Changing Cell Value format as desired while saving the file in the current directory

    Probably,
    Formula: copy to clipboard
    ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & Format(wb.Sheets("Control").Range("C74").Value, "MMM YYY"), xlWorkbookNormal

  3. #3
    Registered User
    Join Date
    09-16-2017
    Location
    Agra
    MS-Off Ver
    2013
    Posts
    72

    Re: Changing Cell Value format as desired while saving the file in the current directory

    https://powerspreadsheets.com/vba-fo...ing-VBA-mmm-yy

    refer this for guidance. You may either while selecting the range, chnge the format of date internally.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Changing Cell Value format as desired while saving the file in the current directory

    Quote Originally Posted by Ravisca2003 View Post
    https://powerspreadsheets.com/vba-fo...ing-VBA-mmm-yy

    refer this for guidance. You may either while selecting the range, chnge the format of date internally.
    Please supply your answer and not a link to the possible answer.

  5. #5
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    347

    Re: Changing Cell Value format as desired while saving the file in the current directory

    @Davesexcel

    Thanks for the snippet.

    Cheers!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA saving row data as xml file to directory specified in row cell
    By BGUNN in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2015, 07:07 AM
  2. Replies: 0
    Last Post: 05-17-2014, 04:21 PM
  3. Saving file in current directory after accessing file in another directory
    By vuxsa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2011, 11:37 AM
  4. Saving current open file to another location and format (macro)
    By flipjarg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2011, 06:26 PM
  5. Conditional saving in a given directory, with always changing file name
    By hunsnowboarder in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2007, 12:26 PM
  6. Saving a File to the Current Directory Using a Macro
    By jim evans in forum Excel General
    Replies: 3
    Last Post: 06-18-2006, 10:20 AM

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