+ Reply to Thread
Results 1 to 2 of 2

Unable to fit in all character in the letter

  1. #1
    Registered User
    Join Date
    02-03-2020
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    28

    Unable to fit in all character in the letter

    Hi there, I seek expert advice to solve the macro writing where I am facing a problem that cannot fit all characters in the pdf once generated.


    This is the script:
    Option Explicit
    Sub Print_PDF()
    Dim Awb As Workbook
    Dim Snr As Integer
    Dim ws As Worksheet
    Set Awb = ActiveWorkbook


    For Each ws In Awb.Sheets
    If Not ((ws.Name = "Data") Or (ws.Name = "Summary")) Then
    If Not (ws.Range("C17").Value = "0" Or ws.Range("C17").Value = "") And Len(Trim(ws.Range("C17").Value)) <> 0 Then
    Awb.Sheets(ws.Name).Copy
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    Awb.Path & "\Payment Advice-" & Awb.Sheets(ws.Name).Range("C17") & "_" & Format(Awb.Sheets(ws.Name).Range("H10"), "yyyy.mm.dd") & ".pdf", _
    Quality:=xlQualityStandard, IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, OpenAfterPublish:=False

    ActiveWindow.Close False
    End If
    End If
    Next ws

    End Sub


    Attached herewith excel for your reference. Many thanks for advice.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,666

    Re: Unable to fit in all character in the letter

    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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. [SOLVED] remove last character if any letter
    By s@skia in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-23-2013, 11:23 AM
  2. [SOLVED] Delete last character if letter
    By dip11 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2012, 07:54 AM
  3. Replies: 1
    Last Post: 07-16-2010, 12:25 PM
  4. Check if character is a letter or a number
    By duckboy1981 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-03-2009, 11:53 AM
  5. Proper Case not doing letter after a character
    By dugong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2008, 12:34 PM
  6. if not numeric and letter then replace character help
    By DKY in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2008, 11:15 AM
  7. Odd! Excel changes my letter character. Why?
    By spygrrl in forum Excel General
    Replies: 5
    Last Post: 03-09-2006, 11:55 AM
  8. Add character before 1st letter of string
    By al007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2005, 08:33 PM

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