title: VBA - Hide rows based on values in multiple Columns
body: <p>I am trying my first bit of code and VBA and have been researching for a while but I cannot get it to work. I am trying to hide rows where the value of multiple columns is either 0 (those that have a formula/numeric value) or those are left blank (text). In my Excel the columns O, AB, AN from row 9-1000 contain numeric values and AJ and AK 9-1000 text values. So I want to hide all those where O, AB and AN is zero AND AJ and AK is blank. I could write the basic code just hiding rows based on the first criteria:</p>
  
  <pre><code>Sub HideAccounts()
  
  Dim TotExp As Range
  Dim Cell As Range
  
  Set TotExp = Range("O9:O1000")
  
  Application.ScreenUpdating = False
  
  For Each Cell In TotExp.Rows
  If Cell.Value = 0 Then
  Cell.EntireRow.Hidden = True
  Else
  Cell.EntireRow.Hidden = False
  
  End If
  
  Application.ScreenUpdating = True
  
  Next Cell
  
  End Sub
  </code></pre>
  
  <p>So now I want to add the other criteria, but I am struggling with the multiple criteria and when I try to insert GoTo statements it does not work either...</p>
  
  <p>Any help is greatly appreciated!!</p>
  
  <p>Thanks,
  Daniela</p>