Thread: If Then
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default If Then

select Case Activesheet.Name
Case "Sheet1", "Sheet2", "Sheet3"
rows(16).Hidden = True
Case "Sheet4"
rows(18).Hidden = True
End Select

would be another way.

--
Regards,
Tom Ogilvy


"Dean" wrote:

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