View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Macro to hide the row if both columns E & F are blank in that row.

Option Explicit
Sub testme01()
Dim LastRow As Long
Dim iRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For iRow = LastRow To 2 Step -1 'headers in row 1????
If Application.CountA(.Cells(iRow, "E").Resize(1, 2)) = 0 Then
.Rows(iRow).Hidden = True
Else
.Rows(iRow).Hidden = False 'unhide it?????
End If
Next iRow
End With
End Sub


I used column A to determine the last used row on the sheet.

Pcakes wrote:

Hi,

I am searching for a Macro or Formula that will hide both columns E&F if
they are blank in that row. Example below:

A B C D
E F
Name Exp Rpts Account Name Account # Debit Credit
__________________________________________________ __________
Nov T & L 0400011111 0.00 768.11
AAAA M & E 0400011111 78.81
Leased Auto 0400011111

Any Ideas?

Thanks!

Pcakes


--

Dave Peterson