+ Reply to Thread
Results 1 to 4 of 4

Changing font colour before saving pdf

Hybrid View

  1. #1
    Registered User
    Join Date
    01-22-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    33

    Changing font colour before saving pdf

    Hi,

    Posted question before, didn't get reply.

    I've got a save as pdf button, but when the button is pressed I want certain text not to show on the saved pdf that is to be sent. With the code bellow I get an error. I've got two sheets in my final pdf file : "Samlet", and "Lager uttak"


    Sub RDB_Sheet_Level_Names_To_PDF_And_Create_Mail()
        Dim FileName As String
    
       
        FileName = Create_PDF_Sheet_Level_Names("addtopdf", "", True, False)
        Sheets("Samlet").Range("C16:H17,G32:G33 ").Font.ColorIndex = vbWhite
         
        If FileName <> "" Then
            RDB_Mail_PDF_Outlook FileName, "", "Emnet går her", _
                                 "Se vedlegg" _
                               & vbNewLine & vbNewLine & "Mvh. ", False
    
        Else
            MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
                   "Microsoft Add-in is not installed" & vbNewLine & _
                   "You Canceled the GetSaveAsFilename dialog" & vbNewLine & _
                   "The path to Save the file in arg 2 is not correct" & vbNewLine & _
                   "You didn't want to overwrite the existing PDF if it exist"
        End If
    End Sub

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Changing font colour before saving pdf

    Use this:
    Sheets("Samlet").Range("C16:H17,G32:G33 ").Font.ColorIndex = 2
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-22-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Changing font colour before saving pdf

    Thanx, worked like a charm

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Changing font colour before saving pdf

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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