title: looping through specific columns and rows
body: <p>I am new to VBA and am trying to loop through columns and rows with specific perimeters. I have the rows done, but moving columns is proving to be difficult. </p>
  
  <p>I have taken a picture due to not uploading the code at this time. I am looking to move down a column starting at 5 and then every 3 places till about 41, then rows starting at 5 move to the right every 2 until row 14 (about letter P).</p>
  
  <p>Any help will be appreciated.</p>
  
  <p>It currently prints out two lines how I want, but any more I don't know how to continue to move to the next row. </p>
  
  <pre><code>Private Sub CommandButton21_Click()
  
  Dim X As Integer
  Dim Y As Integer
  Dim i As Integer
  Dim j As Integer
  Dim k As Integer
  Dim Q As Integer
  Dim r As Integer
  
  X = 5
  j = 5
  k = 2
  Q = 5
  r = 4
  
  For i = 1 To j
     Cells(X, k).Value = 5
     X = X + 3
  
     For Y = 1 To 1
        Cells(Q, r).Value = 2
        Q = Q + 3
  
     Next Y
  Next i
  
  End Sub
  </code></pre>