Results 1 to 3 of 3

Macro to save sheet as pdf

Threaded View

  1. #1
    Registered User
    Join Date
    02-06-2012
    Location
    Queen Creek, AZ
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to save sheet as pdf

    I need a macro that will save the range of cells with values as a pdf and saved as the sheet name. I have a macro that does a print preview function based on the cells that contain values. It works great, but instead I just need this to be saved as a pdf.

    This is what I have:

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim LastRow As Integer
    Dim WhatToPrint As Range
    
    LastRow = ActiveSheet.Range("A65535").End(xlUp).Row
    Set WhatToPrint = ActiveSheet.Range("A1").Resize(LastRow, 19)
    
    End Sub
    
    
    'I would like to use the Button I have set up as well.
    
    Private Sub CommandButton1_Click()
    
    Dim LastRow As Integer
    Dim WhatToPrint As Range
    
    LastRow = ActiveSheet.Range("A65535").End(xlUp).Row
    Set WhatToPrint = ActiveSheet.Range("A1").Resize(LastRow, 19)
    WhatToPrint.PrintPreview
    End Sub
    Any help is greatly appreciated.
    Thanks
    Last edited by FDibbins; 02-27-2014 at 07:06 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 09-03-2013, 09:56 AM
  2. [SOLVED] Macro to save cells from one sheet to new row in another sheet
    By carden2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-13-2013, 12:14 PM
  3. [SOLVED] macro to save sheet with specific file name from sheet
    By mezza89 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2013, 12:04 PM
  4. Replies: 0
    Last Post: 11-22-2012, 08:42 AM
  5. Macro to save sheet as pdf
    By excellentexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2009, 08:09 AM

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