Thread: Hiding columns
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Hiding columns

Hi Scott, This code will do that for you

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

Mike F

"scottwilsonx " wrote in
message ...
Hi everyone, can anyone help !?

I have a table of information, from A19 to F50 where column has titles
and B to F data. The table is linked to other worksheets using the
INDIRECT function and references cell A5 to get the appropriate
sheetname.

What I would like to do is create a VBA macro that will automatically
hide the rows with no data in either column B or E. is this possible ?


Thanks for any and all help.

Best wishes
Scott.


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