+ Reply to Thread
Results 1 to 3 of 3

macro code to save file to new folder with values and not formulas

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    macro code to save file to new folder with values and not formulas

    Hello!!,,

    i am using the below macro to save the excel file to a new folder.but this is copying the formulas and not the values

    Sub SaveBook()
       Dim sFile As String
       sFile = "fixing" & " " & Format(Now(), "dd.mm.yy.hh.mm") & ".xls"
       ActiveWorkbook.SaveAs Filename:="file path" & sFile
       ThisWorkbook.Close Saved = True
    End Sub


    how can i amend it to save the values from the sheets instead of formulas.

    PLease Help

    Many thanks

    Gokz

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: macro code to save file to new folder with values and not formulas

    Sub SaveBook()
       Dim sFile As String
       fpath="C:\test\" '  <<<< to be changed
       sFile = "fixing" & " " & Format(Now(), "dd.mm.yy.hh.mm") & ".xls"
       For Each ws In ActiveWorkbook.Worksheets
         With ws.UsedRange
           .Value = .Value
         End With
       next
       ActiveWorkbook.SaveAs Filename:=fpath & sFile
       ThisWorkbook.Close Saved = True
    End Sub
    Last edited by patel45; 02-01-2013 at 06:44 AM.
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Re: macro code to save file to new folder with values and not formulas

    @patel

    Many Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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