title: How to transpose a single row then export that to PDF from excel 2007 in VBA
body: <p>Im very very new to coding, especially in VBA, and Im having problems I hope someone can help me with. I've tried a few solutions online but I cant seem to get it working. Im also stuck in excel 2007 :/</p>
  
  <p>I have a worksheet that has a userform I've built in VBA that will add some data to a bunch of columns. Ive also got some formulas that modify some of that data and produce a unique identifier to each one, this is important later.</p>
  
  <p>Im trying to export each individual row (with the shared headers) into a PDF, and I figure transposing it to 2 columns would work much better. So far I can only export the whole worksheet and it comes out terrible with 88 pages of mostly nothing. The hard mode of this is that I also want it to be named the unique identifier and hyperlinked back into the spreadsheet under that cell..</p>
  
  <p>I know im asking a lot but if anyone can send me in the right direction Id really appreciate it, even links to others. I dont know enough to even know what Im looking for. Any comments at all are appreciated.</p>
  
  <p>My code so far, again, sorry for the mess;</p>
  
  <p>Many thanks for <strong>any help</strong> at all!</p>
  
  <pre><code>Dim iRow As Long
  Dim ws As Worksheet
  Set ws = Worksheets("Sheet1")
  'find first empty row in database
  iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
  SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
  
  
   With ws
   '  .Unprotect Password:="password"
  .Cells(iRow, 1).Value = Format(Date, "mm-dd-yyyy")
  .Cells(iRow, 2).Value = Me.ComboBox7.Value
  .Cells(iRow, 3).Value = Me.TextBox12.Value
  .Cells(iRow, 4).Value = Me.TextBox11.Value
  .Cells(iRow, 5).Value = Me.CheckBox4.Value
  .Cells(iRow, 6).Value = Me.ListBox4.Value
   'Row 7 Reserved for Identifier Code!!
  .Cells(iRow, 8).Value = Me.TextBox4.Value
  .Cells(iRow, 9).Value = Me.TextBox6.Value
  .Cells(iRow, 10).Value = Me.ComboBox5.Value
  .Cells(iRow, 11).Value = Me.ComboBox6.Value
  .Cells(iRow, 12).Value = Me.TextBox7.Value
  .Cells(iRow, 13).Value = Me.TextBox8.Value
  .Cells(iRow, 14).Value = Me.TextBox13.Value
  .Cells(iRow, 15).Value = Me.TextBox14.Value
  .Cells(iRow, 16).Value = Me.TextBox2.Value
  .Cells(iRow, 17).Value = Me.TextBox5.Value
  .Cells(iRow, 18).Value = Me.TextBox9.Value
  .Cells(iRow, 19).Value = Me.ComboBox4.Value
  .Cells(iRow, 20).Value = Me.TextBox10.Value
  .Cells(iRow, 21).Value = Me.TextBox15.Value
  .Cells(iRow, 22).Value = Me.CheckBox5.Value
  .Cells(iRow, 23).Value = Me.CheckBox6.Value
  .Cells(iRow, 24).Value = Me.CheckBox7.Value
  .Cells(iRow, 25).Value = Me.CheckBox8.Value
  .Cells(iRow, 26).Value = Me.CheckBox9.Value
  
  End With
  
  
  'Export to PDF.. needs work...
  
  Private Sub CommandButton5_Click()
  Application.ScreenUpdating = False
  ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
          Filename:="C:\Users\Admin\Documents\Excel Testing\Export.pdf", _
          OpenAfterPublish:=False
   Application.ScreenUpdating = True
  
  End Sub
  </code></pre>