Results 1 to 8 of 8

VBA Save As get directory from cell

Threaded View

lukestkd VBA Save As get directory... 08-10-2012, 06:33 AM
tigeravatar Re: VBA Save As get directory... 08-10-2012, 11:02 AM
lukestkd Re: VBA Save As get directory... 08-10-2012, 03:43 PM
tigeravatar Re: VBA Save As get directory... 08-10-2012, 04:47 PM
lukestkd Re: VBA Save As get directory... 08-10-2012, 04:57 PM
tigeravatar Re: VBA Save As get directory... 08-10-2012, 05:01 PM
lukestkd Re: VBA Save As get directory... 08-10-2012, 05:11 PM
tigeravatar Re: VBA Save As get directory... 08-10-2012, 05:15 PM
  1. #1
    Forum Contributor
    Join Date
    07-30-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2013
    Posts
    177

    VBA Save As get directory from cell

    I have the following code on a macro, which saves sets the print area, saves as PDF and sets the filename to the value in F4.
    Sub mcr_saveaspdf()
    Dim LR As Long
    LR = Range("A" & Rows.Count).End(xlUp).Row
    ActiveSheet.PageSetup.PrintArea = "A1:E" & LR
    namefile = Range("F4").Value
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=namefile
    End Sub

    That is working perfectly, but I need I need to create three more macro buttons to make it useful for our school, this also needs to use the code above to set print area and filename.


    1 - Save a PDF copy to a destination where the last section = J2
    (e.g. F:\RMSharedDocs\LPo\J2) - J2 would be "10lIt1\StudentName"
    AND
    Save an excel copy to a destination where the last section is the name as above, but the other part would be (N:\Documents\Feedback\J2)


    2 - Save a PDF copy to a destination where last section is as above, but the first section is in J1. (e.g. "J1""F4") - (C:\Documents and Settings\lukepollard\Desktop\Feedback\10lIt1\StudentName)


    3 - Launch SaveAs dialog and set file type to macro enabled workbook


    Apologies to bombard - any advice would be greatly appreciated


    Luke

    FILE ATTACHED: feedbackversionforExcelForum.xlsm
    Last edited by lukestkd; 08-10-2012 at 03:44 PM.

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