title: Excel VBA. How to select a certain cell, then offset a variable number or rows down, and then print that selection
body: <p>Just like it says in the title. I need to print in an area from B18 to J18 and down a variable number of rows. I don't know how to set this up. That variable number is being kept in cell O24 by using a <code>=COUNTA(B20:B65536)</code>function. I just need the selection to go down that many number of rows. </p>
  
  <p>Here is my code so far. </p>
  
  <pre><code>Sub PrintPlease()
  
  I = Cells("O24").Value
  
  With ActiveSheet.PageSetup
      .Zoom = False
      .Orientation = xlPortrait
      .FitToPagesWide = 1
      .FitToPagesTall = 1
  
      ExecuteExcel4Macro ("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})")
      If .Zoom &lt; 30 Then
          .Zoom = 50
      Else
          .Zoom = False
          .FitToPagesWide = 1
      End If
  
  End With
  
  Range ("B18:J18"), Cells("B18").Offset((I), 3).PrintOut, Preview:=True
  
  End Sub
  </code></pre>