Thread: Shorter code
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis[_5_] Dana DeLouis[_5_] is offline
external usenet poster
 
Posts: 77
Default Shorter code

Would this idea work for you?

Sub Demo()
[B3:B21].SpecialCells(xlBlanks).Offset(1, 0).EntireRow.Hidden = True
End Sub


The assumption here is that the rows are all unhidden at the start.
HTH
--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Stu" wrote in message
...
I have a big macro code but it is mostly repeated is there anyway to
make this macro smaller?
below is the code:

Sub EuropeJan()

If Range("B3").Value = "" Then
Range("B4").EntireRow.Hidden = True
Else
Range("B4").EntireRow.Hidden = False
End If

If Range("B4").Value = "" Then
Range("B5").EntireRow.Hidden = True
Else
Range("B5").EntireRow.Hidden = False
End If


<snip