Thread: Hiding columns
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
scottwilsonx[_11_] scottwilsonx[_11_] is offline
external usenet poster
 
Posts: 1
Default Hiding columns

Thanks both,

Not sure if I am missing something simple. But the following code won'
run, and instead gives me the following error "compile error nex
without for". Any ideas !?

Thanks

Sub HideEmpty()
Dim r As Integer
For r = 19 To 50
If Range("B" & r).Value = "" Or Range("E" & r).Value = "" Then
Rows(r).EntireRow.Hidden = True
Next r
End Sub

--
Message posted from http://www.ExcelForum.com