+ Reply to Thread
Results 1 to 3 of 3

Using VBA to print and save as a range of cells

  1. #1
    Registered User
    Join Date
    04-19-2007
    Posts
    2

    Using VBA to print and save as a range of cells

    I require help to write a macro to print a sheet from a workbook and save that sheet as a user defined file. What is listed below saves the entire workbook as the same file.

    ActiveWindow.SelectedSheets.PrintPreview
    ChDir "C:\Documents and Settings\dnoonan\My Documents\Estimates"
    ActiveWorkbook.SaveAs Filename:= _
    "C:\Documents and Settings\dnoonan\My Documents\Estimates\"".xls", _
    FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False
    End Sub

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Hi, What do you mean by a user defined file???

  3. #3
    Registered User
    Join Date
    04-19-2007
    Posts
    2
    When the script saves as i want to define the file name the spreadsheet will be saved as.

    I have a large spreadsheet with pages of data and would like the macro to print a rage of cells in one worksheet and save that range of cells to a file

+ Reply to Thread

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