Thread: If Then
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default If Then

Sub test()
If ActiveSheet.Name = "Sheet1" Or ActiveSheet.Name = "Sheet2" Or
ActiveSheet.Name = "Sheet3" Then
Rows("16").EntireRow.Hidden = True
ElseIf ActiveSheet.Name = "Sheet4" Then
Rows("18").EntireRow.Hidden = True
End If
End Sub

Regards,
Stefi


€žDean€ť ezt Ă*rta:

Can someone give me the exact code for the following general situation:

If the active worksheet when a macro is called is sheet 1 or sheet2 or sheet3, then hide row 16. Or, if sheet 4, hide row 18. If any other sheet, don't hide anything - that I suppose requires no text!

Thanks!
Dean