peoplesoft
New Member
- Joined
- May 12, 2011
- Messages
- 5
Hello
I have seen various types of Logic to Hide Rows and Columns in Excel, I am already Using a Dirty Way of doing it. But I was thinking maybe someone can help me build a better way of Doing it.
Here is a sample Data:
Basically my request is to Find the "Start-P&L" and "End-P&L" Texts and Hide the Entire Row and Columns of that Range B3:F10. The Cell Position is not Constant so it is Key that I find these Texts and then Hide the Corresponding Cells.
If I can Hide the Range (B3:F10) it will be Awesome too. But I don't Know if that can be done or not.
I hard coded the Cells with a text "BS"
My Code as You see from the screenshot is something like this:
Sub HideRows1()
Dim cell As Range
For Each cell In Range("A:IV")
If UCase(cell.Value) = "BS" Then
cell.EntireRow.Hidden = True
cell.EntireColumn.Hidden = True
End If
Next
End Sub
Please Help
Thanks in Advance
Peoplesoft Guy
I have seen various types of Logic to Hide Rows and Columns in Excel, I am already Using a Dirty Way of doing it. But I was thinking maybe someone can help me build a better way of Doing it.
Here is a sample Data:
HTML:
https://picasaweb.google.com/lh/photo/eGI3mjH5jRRGZtrQZOT_x69YdAVc8bz5Ke_LoJMPuVQ?feat=directlink
If I can Hide the Range (B3:F10) it will be Awesome too. But I don't Know if that can be done or not.
I hard coded the Cells with a text "BS"
My Code as You see from the screenshot is something like this:
Sub HideRows1()
Dim cell As Range
For Each cell In Range("A:IV")
If UCase(cell.Value) = "BS" Then
cell.EntireRow.Hidden = True
cell.EntireColumn.Hidden = True
End If
Next
End Sub
Please Help
Thanks in Advance
Peoplesoft Guy