What I am trying to achieve is if row in column has a zero or error
then hide row, which is the easy part and I have managed to do that,
the issue is I have got it to ignore blanks which I want to happen,
however the finished product doesn't look right when this happens as
more than one blank row is next to each other. I want to put some code
in so that it looks at the visible cells in the column and if a blank
is next to a blank then hide one of them

COLUMN
5
5
3
0
0

0
1

0

0
0
1

When the script I got at moment runs the result is:

COLUMN
5
5
3

1

         <- want to hide this as well (but will only get this
happening when others are hidden
1


I did think of using other columns to flag blanks etc. The blanks
should always be on the same rows however I will never know if the
zeros will make two blanks visible next to each other.

Script so far--

Sub HideZeros()

k = Range( _
"DA" & Rows.Count).End(xlUp).Row
Range("BA7").Value = k

For i = 8 To Range( _
"DA" & Rows.Count).End(xlUp).Row
j = i - 1
If IsEmpty(Cells(i, 105).Value) Then
Cells(i, 1).EntireRow.Hidden = False


' THIS IS LATEST IDEA WHICH DIDN'T WORK AS j DOESN'T LOOK AT JUST
VISIBLE
'ElseIf IsEmpty(Cells(j, 105).Value) = SpecialCells(xlVisible(j,
105).Value) Then
' Cells(i, 1).EntireRow.Hidden = True


ElseIf Application.Sum(Cells(i, 105), Cells(i, 107)) = 0 Then
Cells(i, 1).EntireRow.Hidden = True
Else: On Error Resume Next
End If
Next

End Sub

Got any ideas?

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to [email protected]
If you find any spam message in the group, please send an email to:
Ayush Jain  @ [email protected] or
Ashish Jain @ [email protected]
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to