+ Reply to Thread
Results 1 to 9 of 9

Need Help with PDF Printing VBA

  1. #1
    Registered User
    Join Date
    05-04-2018
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    6

    Smile Need Help with PDF Printing VBA

    I need help to create a macro to print to PDF.
    If cell H4 contains ”Hi” then print sheet Hi.
    If H4 contains ”Bye” then print sheet bye.
    Save it to folder …..

    After the printing i want put OK in a list
    Example. In C4 there are a uniqe number. I want it to find what row in C10- C10000 it is and write Ok on column I.

    Thx in advance =)

  2. #2
    Registered User
    Join Date
    05-04-2018
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Need Help with PDF Printing VBA

    Oh and i forgot =)
    I also would like that the pdf file is named from cell H4 and C4
    Example
    Cell H4 "Bye"
    Cell C4 "Jonas"
    Name of pdf "Bye_Jonas.pdf"

  3. #3
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Need Help with PDF Printing VBA

    In the 1st post -
    C4 there are a uniqe number
    In the 2nd post-
    Cell C4 "Jonas"
    "Jonas" doesn't seem to be a number...

  4. #4
    Registered User
    Join Date
    05-04-2018
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Need Help with PDF Printing VBA

    Hehe True, but what i want is it to Vlookup in column C and find in this case "Jonas", But there will be social security number there
    example 19800101-1234

  5. #5
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Need Help with PDF Printing VBA

    Possibly...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-04-2018
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Need Help with PDF Printing VBA

    Sweet, and is it possible that it will choose what sheet to print?
    if cell H4
    is Hi Print Sheet 1
    Is Bye print sheet 2
    etc

  7. #7
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Need Help with PDF Printing VBA

    Using Select Case...
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-04-2018
    Location
    Sweden
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Need Help with PDF Printing VBA

    Sweet thx alot, it work, but not the
    Set c = .Range("c10:c10000").Find(.Cells(4, 3).Value)
    If Not c Is Nothing Then
    c.Offset(, 6) = "OK"

    Had to delete this rows then it worked =)


    Jonas

  9. #9
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Need Help with PDF Printing VBA

    That bit of code does a search for the value in C4. If that value wasn't found, it exits the routine.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 04-17-2021, 05:08 AM
  2. [SOLVED] Page Breaks are Printing on my document - how can I suppress printing them?
    By pongmeister in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2018, 11:40 AM
  3. [SOLVED] Dynamic printing area for logic and economic printing
    By vendam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2018, 01:43 AM
  4. Replies: 1
    Last Post: 06-11-2014, 09:23 AM
  5. Replies: 0
    Last Post: 02-27-2014, 01:31 PM
  6. Replies: 0
    Last Post: 09-18-2013, 06:34 AM
  7. Replies: 3
    Last Post: 07-16-2012, 03:24 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