title: Export to pdf with range selection cell in one page
body: <p>I can not export to PDF, in horizontal format all my range selection, Where am I doing wrong?</p>
  
  <pre><code>Sub Macro()
  Dim wksht As Worksheet
  Set wksht = ActiveSheet
  
  Dim path As String
  path = "C:\test\"
  
  If Len(Dir(path, vbDirectory)) = 0 Then
      MkDir path
  End If
  
  Dim rngeStart
  Dim rngeEnd
  
  Set rngeStart = wksht.UsedRange.Find(What:="####", LookIn:=xlValues, LookAt:=xlWhole)
  Set rngeEnd = wksht.UsedRange.FindNext(After:=rngeStart)
  
  Dim dataRange As Range
  Set dataRange = wksht.Range(rngeStart, rngeEnd)
  
  Dim wb As Workbook
  Dim i As Long
  
  For i = 1 To wksht.Range("A" &amp; wksht.Rows.Count).End(xlUp).Row
    wksht.Copy
    With ActiveSheet
       .Range(.Cells(1, 1), .Cells(1, rngeStart.Column - 1)).EntireColumn.Delete
       .Rows("1:" &amp; rngeStart.Row - 1).Delete
  End With
  </code></pre>
  
  <p>This part for Export in PDF, only one page without all range selection:</p>
  
  <pre><code>ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=path &amp; wksht.Range("A" &amp; i).Value &amp; ".pdf", _ Quality:=xlQualityStandard,
      IncludeDocProperties:=True, IgnorePrintAreas:=False 
  ActiveWorkbook.Close 
    Next i
  End Sub
  </code></pre>
  
  <p>is there a function "fit to onepage" export in pdf?</p>