View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
barkiny
 
Posts: n/a
Default hide rows when the cell is #VALUE!


i want to write a macro when a cell gives error then hide the entire row
(
#VALUE! )

Sub HideRows()
BeginRow = 1
EndRow = 10
ChkCol = 2

For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "-" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub

thanks in advance


--
barkiny
------------------------------------------------------------------------
barkiny's Profile: http://www.excelforum.com/member.php...o&userid=20397
View this thread: http://www.excelforum.com/showthread...hreadid=521016