Results 1 to 10 of 10

Exporting columns into new workbook as text values not formulas

Threaded View

  1. #9
    Registered User
    Join Date
    11-27-2012
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Exporting columns into new workbook as text values not formulas

    Try

    Sub Export()
        
        Dim strFileName As String
        Dim d As Long
        d = Format(Now, "yyyymmdd")
        Range("Y2:Y250,BL2:BL250") = d
        
        strFileName = InputBox("Type a name for the new workbok", "File Name")
        If Trim(strFileName) = vbNullString Then Exit Sub
        
        Application.ScreenUpdating = False
        Application.DisplayAlerts = False
        
        Range("Y2:BL250").Copy
        Sheets.Add.Range("A1").PasteSpecial xlPasteValues
        Application.CutCopyMode = False
        ActiveSheet.UsedRange.EntireColumn.AutoFit
        ActiveSheet.Move
        ActiveWorkbook.SaveAs "J:\shared\Swaps\Equity Finance\Ryan\" & strFileName & ".xls", xlOpenXMLWorkbookMacroEnabled
        ActiveWorkbook.Close False
        
        Application.DisplayAlerts = True
        Application.ScreenUpdating = True
        
    End Sub
    Last edited by billstpierre79; 05-30-2013 at 03:57 PM. Reason: Code edit

Thread Information

Users Browsing this Thread

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

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