I have this code, and I can't print only one column (first green selection), what setting do you think I'm missing in the page-setup?
Example:
Code:
Example:
Code:
Code:
Sub PrintPDF()
Dim LastCellRow
LastCellRow = ActiveSheet.Range("A60").End(xlUp).Row
While Cells(LastCellRow, 60) = "."
LastCellRow = LastCellRow - 1
Wend
strDir = "C:\Users\Carlos Hernandez\Google Drive\Cano Roofing\IMGENES\"
If Dir(strDir, vbDirectory) = "" Then
With ActiveSheet
.PageSetup.PrintArea = Range("O1", Cells(LastCellRow, 15)).Address '"$A$7:$A$50"
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.1)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.PaperSize = xlPaperLetter
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Users\Carlos Hernandez\Google Drive\Cano Roofing\IMGENES\Personal.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End With
End Sub