Thanks for the feed back folks. I'm new with VB. I'm using the following code (as it's the only one i seem to understand) but I get an error when I try to compile it. By the way the object is sheet1.
Run-Time error '424, Object required
Function hidrows()
Template.ActiveSheet.Protection.Enabled = False
Template.ActiveSheet.Calculate
For intRow = 1 To Template.ActiveSheet.UsedRange.Rows.Count
If Template.Cells(intRow, 1).Value = "X" Or Template.Cells(intRow, 1).Value = "x" Then
For intCol = 1 To Template.ActiveSheet.UsedRange.Columns.Count
If Template.Rows(intRow).EntireRow.Hidden = False Then
Template.Rows(intRow).EntireRow.Hidden = True
End If
Next
End If
Next
Template.ActiveSheet.Protection.Enabled = True
End Function
Bookmarks