Code to hide rows accross multiple sheets based on cell content.

Mauro Arguello

New Member
Joined
Nov 26, 2005
Messages
3
I need the macro code to hide rows on several sheets at once based on their content. Like if cell contains letter "U" hide that row... this in several sheets.

Thank You,

Mauro
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
This is the code that I'm using but it only works on one sheet.

Sub LAonly()

Const LetterToHide = "U"

On Error GoTo Whoops

ActiveSheet.Unprotect "1"

Rows.Hidden = False

With Columns("o")

.Replace LetterToHide, "#N/A", xlWhole

With .SpecialCells(xlCellTypeConstants, xlErrors)

.EntireRow.Hidden = True

.Value = LetterToHide


Sheets("RENAL").Select

ActiveSheet.Unprotect "1"

With Columns("n")

.Replace LetterToHide, "#N/A", xlWhole

With .SpecialCells(xlCellTypeConstants, xlErrors)

.EntireRow.Hidden = True

.Value = LetterToHide

End With

End With

End With

Whoops:

ActiveSheet.Protect "1"

Sheets("PRESUPUESTO 2013").Select

End With

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,413
Members
449,082
Latest member
tish101

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top