Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Need macro to save as pdf in specific folder with cell value and date.

  1. #1
    New Member
    Join Date
    Apr 2010
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Need macro to save as pdf in specific folder with cell value and date.

    Can anyone help me with creating a macro that will save the worksheet as a pdf in a specific folder with the value of a cell and the date. This is what I have so far.

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("H10").Value & Format(Date, "mmdd")

    This saves it as the correct cell value + the date, but it saves it to my documents. I need it to save to a shared folder on a network drive.

    Any help would be greatly appreciated.
    THANKS

  2. #2
    Board Regular somnath_it2006's Avatar
    Join Date
    Apr 2009
    Location
    Pune, India
    Posts
    574
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Need macro to save as pdf in specific folder with cell value and date.

    Add the conman network path before PDF file name

    e.g.

    Code:
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="P:\NetworkFolder\NetworkSubfolder\" & Range("H10").Value & Format(Date, "mmdd")
    Regards,
    Som



    The more we come out and do good to others, the more our hearts will be purified, and God will be in them. - Swami Vivekananda

  3. #3
    New Member
    Join Date
    Apr 2010
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Need macro to save as pdf in specific folder with cell value and date.

    Thanks, Thats exactly what I needed.

  4. #4
    New Member
    Join Date
    Jan 2016
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Need macro to save as pdf in specific folder with cell value and date.

    I borrow this tread
    Im trying to write a macro that saves to .pdf accoring tha name in cell F4
    this
    Code:
    Sub Makro1()
    '
    ' Makro1 Makro
    '
    
    
    '
        Range("A2:J23").Select
        ChDir "I:\LC2016\Individuell"
        ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            "I:\LC2016\Individuell\& Range("F4").Value & ".pdf" ", Quality:=xlQualityStandard, _
            IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
            True
    End Sub
    gives sybtax-error
    Please help mee
    /Peter

  5. #5
    New Member
    Join Date
    Jan 2016
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Need macro to save as pdf in specific folder with cell value and date.

    I found out why , the code was missing a "
    Code:
    Sub Makro1()'
    ' Makro1 Makro
    '
    
    
    '
        Range("A2:J23").Select
        
        ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            "I:\LC2016\Individuell\" & Range("F4").Value & ".pdf", Quality:=xlQualityStandard, _
            IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
            True
    End Sub

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •