The code that I currently have works... But, I just quickly put it together in order to test my 'concept' (which is the code directly below the If Cells(88, 1) = "MTHLY" part...) Now that I know that it works, I need to replace the If Cells(88, 1) = "MTHLY" part of the code. Currently that code references a specific cell "(88, 1)" to where it is searching for the string ("MTHLY"). I need the new code to look within a range between anywhere starting in column A, row 15... and down to the last row in that column that contains any data...
Here is my current code:
A couple things... the range that the code will be searching will only contain one visible row- in my example that row is 88; but it could be any row (any row number below 15, that is.
And there will always be just one row remaining in the range (never more than one, and just one.)
Column A is unhidden for the screen shot so that you can see where the "MTHLY" is located.
Thank you for any suggestions!
Here is my current code:
VBA Code:
If Cells(88, 1) = "MTHLY" Then
'*********
For Each Cell In Range(Cells(2, 26), Cells(2, PCol)).SpecialCells(xlCellTypeVisible)
If Cell Like "*Sa*" Then
Columns(Cell.Column).Hidden = True
Else
Columns(Cell.Column).Hidden = False
End If
Next
'*********
For Each Cell In Range(Cells(5, 26), Cells(5, PCol)).SpecialCells(xlCellTypeVisible)
If Cell Like "*P*" Then
Columns(Cell.Column).Hidden = True
Else
Columns(Cell.Column).Hidden = False
End If
Next
'*********
Else
End If
'*********
A couple things... the range that the code will be searching will only contain one visible row- in my example that row is 88; but it could be any row (any row number below 15, that is.
And there will always be just one row remaining in the range (never more than one, and just one.)
Column A is unhidden for the screen shot so that you can see where the "MTHLY" is located.
Thank you for any suggestions!