title: Excel VBA - Macro loop until lastrow
body: <p>I have the following code on Sheet3 (I have a similar code on Sheet4), that is working row by row. </p>
  
  <pre><code>Sub Checker(argi As Long)
      If (Range("B" &amp; argi).Text = "Insert") Then
          Call Tiers_1_to_3(argi)
          Call CI_Desc(argi)
          Call Tiers_Desc(argi)
          Call Site(argi)
          Call Support_Group_2(argi)
          Call Support_Group_3(argi)
          Call Product_Name(argi)
          Call Model_Name(argi)
          Call Mgmt_Components(argi)
          Call ITSM_Group(argi)
          Call Only_Values(argi)
          Call MandatoryColors(argi)
      End If
      Range("F" &amp; argi + 1).Select
  End Sub
  </code></pre>
  
  <p>This is part of something bigger, this sub 'Checker' contains all the sub routines that work over the main code; since this is running row by row, I want to cast it from a button on the "ThisWorkbook" sheet.</p>
  
  <p>I've came up with several workarounds, but I'm unable to do so.</p>
  
  <pre><code>Sub Refresh()
      Dim i As Long
      Dim LastRow As Long
      LastRow = Range("B" &amp; Rows.Count).End(xlUp).Row
      For Each i In Range("F" &amp; LastRow)
              Call Sheet4.Checker
      Next i
  End Sub
  </code></pre>
  
  <p>The Worksheet arrangement is the following: </p>
  
  <p><code>Sheet_Portal</code>: Autopopulates an UserForm with shortcuts to Sheet3 and Sheet4.</p>
  
  <p><code>Sheet3</code>: Data entry sheet with Checker variation 1.</p>
  
  <p><code>Sheet4</code>: Data entry sheet with Checker variation 2.</p>
  
  <p><code>Thisworkbook</code>: This is where I store all the shared info, such as the button that will trigger Checker 1 and 2.</p>
  
  <p>Long story short, I would like some of your powers to help me on this matter.</p>
  
  <p><strong>UPDATE # 1</strong></p>
  
  <p>Following your comments, I was able to create a button that triggers the code</p>
  
  <pre><code>Sub Refresh()
      Dim i As Long
      Dim LastRow As Long
      LastRow = Range("B" &amp; Rows.Count).End(xlUp).Row
      For i = 5 To LastRow
              Call Sheet4.Checker(i)
      Next i
  End Sub
  </code></pre>
  
  <p>Please check the main code @<a href="https://stackoverflow.com/questions/41337671/excel-vba-long-value-increasing-within-subroutines">EXCEL VBA - Long Value increasing within subroutines</a></p>
  
  <p><strong>UPDATE # 2</strong></p>
  
  <p>Please check the sheets I have used and how is managed</p>
  
  <p><a href="https://i.stack.imgur.com/1xUgb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1xUgb.png" alt="Workbook arrangement"></a></p>
  
  <p>ThisWorkbook code below</p>
  
  <pre><code>Private Sub Workbook_Open()
      Worksheets("Version Control").Activate
      MainPortal.Show vbModeless
  End Sub
  Private Sub UserForm_Click()
      MainPortal.Show vbModeless
  End Sub
  Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
      Dim i As Long
      Dim LastRow As Long
      LastRow = Range("B" &amp; Rows.Count).End(xlUp).Row
      For i = 5 To LastRow
          If ActiveSheet.Range("B5").Value &gt; 1 Then
              If ActiveSheet.Range("BV" &amp; i).Value = "" Then
                  Cancel = True
                  MsgBox "Please complete all mandatory values"
              Exit Sub
              Else
              End If
          End If
      Next i
  End Sub
  Sub Refresh()
      Dim i As Long
      Dim LastRow As Long
      LastRow = Range("B" &amp; Rows.Count).End(xlUp).Row
      For i = 5 To LastRow
              Call Sheet4.Checker(i)
      Next i
  End Sub
  </code></pre>
  
  <p>ThisWorkbook  stores an Workbook_Open for open an userForm at begining of the file and its main button, a Workbook_BeforeSave which check is two values are empty then save file is disabled and the Refresh button.
  The main file stores a similar Workbook_BeforeSave which checks mandatory fields.</p>