Hi. I’ve spent most of this day looking through Excel help and the internet trying to find a solution. I am VERY new at VBA, so please bear with me. I’m using VBA to hide rows in a sheet, and the column that determines whether or not to hide a row has references to another sheet throughout. I’d like for the code to stop at a certain point (either where a column value returns with zero OR where it would equal another cell in that row) instead of having to run the macro through cells it doesn’t need to look at. Below is what I have so far. I think I need to change the “EndRow =” reference, but I’m not sure to what. Thanks in advance for the help.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>
Sub HURows()<o></o>
BeginRow = 2<o></o>
EndRow = 1000<o></o>
ChkCol = 4<o></o>
<o> </o>
For RowCnt = BeginRow To EndRow<o></o>
If Cells(RowCnt, ChkCol).Value > 0 Then<o></o>
Cells(RowCnt, ChkCol).EntireRow.Hidden = True<o></o>
Else<o></o>
Cells(RowCnt, ChkCol).EntireRow.Hidden = False<o></o>
End If<o></o>
Next RowCnt<o></o>
End Sub<o></o>
<o> </o>
Sub HURows()<o></o>
BeginRow = 2<o></o>
EndRow = 1000<o></o>
ChkCol = 4<o></o>
<o> </o>
For RowCnt = BeginRow To EndRow<o></o>
If Cells(RowCnt, ChkCol).Value > 0 Then<o></o>
Cells(RowCnt, ChkCol).EntireRow.Hidden = True<o></o>
Else<o></o>
Cells(RowCnt, ChkCol).EntireRow.Hidden = False<o></o>
End If<o></o>
Next RowCnt<o></o>
End Sub<o></o>