I have a worksheet of hidden rows that I would like to hide more rows from. The desired function is written as "If a non-hidden rows value (in column C) is equal to the value of any hidden row's column C value, then hide that non-hidden row."
The first function that I wrote (that works to hide rows based on task in column G) is:
Sub HideCompletes()
For Each cell In ActiveSheet.Range("G5:G200")
If cell.Value = "Completed" Or cell.Value = "" Then
cell.EntireRow.Hidden = True
End If
Next cell
End Sub
The follow up function and hide I want to do based on those values is the part that I cannot seem to write, this is the very wrong piece I have:
'Column C is full of names, I need to hide the rows with names that match the hidden rows names
Sub RemoveMultipleEntries()
For Each cell.EntireRow.Hidden = True In ActiveSheet.Range("C5:C200")
If cell.EntireRow.Hidden = False And In Range("C5:C200").Value Then
cell.EntireRow.Hidden = True
End If
Next cell
End Sub
'I feel as though I need multiple in statements to accomplish this but can not wrap my head around how this needs to be written from the first variable in the for statement.
The first function that I wrote (that works to hide rows based on task in column G) is:
Sub HideCompletes()
For Each cell In ActiveSheet.Range("G5:G200")
If cell.Value = "Completed" Or cell.Value = "" Then
cell.EntireRow.Hidden = True
End If
Next cell
End Sub
The follow up function and hide I want to do based on those values is the part that I cannot seem to write, this is the very wrong piece I have:
'Column C is full of names, I need to hide the rows with names that match the hidden rows names
Sub RemoveMultipleEntries()
For Each cell.EntireRow.Hidden = True In ActiveSheet.Range("C5:C200")
If cell.EntireRow.Hidden = False And In Range("C5:C200").Value Then
cell.EntireRow.Hidden = True
End If
Next cell
End Sub
'I feel as though I need multiple in statements to accomplish this but can not wrap my head around how this needs to be written from the first variable in the for statement.