title: Excel/Visual Basic Macro on Hidden Sheets
body: <p>Ive written a macro that takes some source data and writes it onto several sheets, which id like to remain hidden before and after the macro has run. Having written the Macro, when I run it it only updates a few records on each sheet (for instance on the first hidden sheet it updates 21 rows out of over 1000. What is the reason for this happening? Surely it should update them all or none of them? Im not getting any errors either. Ive tried </p>
  
  <pre><code>Application.ScreenUpdating = False
  Worksheets("FT Raw").Visible = True
  Worksheets("L1").Visible = True
  Worksheets("L2").Visible = True
  Worksheets("L3").Visible = True
  Worksheets("L4").Visible = True
  </code></pre>
  
  <p>But still only 21 rows get updated.</p>
  
  <p>Update: This is the code that is running on each sheet</p>
  
  <pre><code>endval = Cells(Rows.Count, 1).End(xlUp).Row
  
  For i = 1 To endval
      If Not Sheets("FT Raw").Cells(i, "A") = "" Then
          splitted = Split(Sheets("FT Raw").Cells(i, "A"), ",")
          Sheets("FT Raw").Cells(i, "B") = splitted(0)
          Sheets("FT Raw").Cells(i, "C") = splitted(1)
          Sheets("FT Raw").Cells(i, "D") = splitted(2)
          If Sheets("FT Raw").Cells(i, "D") = "1" Then
              Sheets("L1").Cells(j, "A") = Trim(splitted(0))
              Sheets("L1").Cells(j, "B") = Trim(splitted(3))
              j = j + 1
          End If
      End If
  Next i
  </code></pre>