PDA

View Full Version : exportasfixed format specific range not working



rosalie
12-04-2017, 10:07 AM
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

mancubus
12-05-2017, 12:32 AM
Column 1542 is Column BGH.
does your table really contain 1542 columns of data?

see if this helps:
http://www.vbaexpress.com/forum/showthread.php?46789-Save-Excel-to-PDF-one-page-wide

rosalie
12-05-2017, 01:41 AM
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 :)