Consulting

Results 1 to 3 of 3

Thread: exportasfixed format specific range not working

  1. #1
    VBAX Regular
    Joined
    Oct 2017
    Posts
    8
    Location

    exportasfixed format specific range not working

    Hi everyone,

    I am trying to export a specified range on my active sheet to pdf at the end of my module. I have the following code and whilst it works, I cannot figure out how to get the scaling to 1 page and at the moment the pdf is around 20 pages long:

    Dim rngPDF as rng
    Set rngPDF = ActiveSheet.Range(Cells(1, 1), Cells((UBound(LoopList) + 6 + intSignalCount), 1542))
    With ActiveSheet.PageSetup
     .PrintArea = rngPDF
     .FitToPagesTall = 1
     .FitToPagesWide = 1
     .Orientation = xlLandscape
    End With
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="P:\Southampton\TTS\M2M STV plots\" & strSaveDate & "2.pdf", IgnorePrintAreas:=False
    does anyone know how I can scale to 1 page??

    Many thanks in advance

    Rosalie
    Last edited by Aussiebear; 12-05-2017 at 02:47 AM. Reason: Added code tags

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    Column 1542 is Column BGH.
    does your table really contain 1542 columns of data?

    see if this helps:
    http://www.vbaexpress.com/forum/show...-one-page-wide
    Last edited by mancubus; 12-05-2017 at 12:51 AM. Reason: link to the vbax thread added
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    VBAX Regular
    Joined
    Oct 2017
    Posts
    8
    Location
    Hi,
    I'm using the R1C1 notation as I find it easier.

    There are that many columns but column 4 to 360 are hidden as are columns 664 to 1445 (this is a requirement from work as we may need the other data at some point).

    Thanks, I'll check out that link

Tags for this Thread

Posting Permissions

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