View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Berend Botje[_19_] Berend Botje[_19_] is offline
external usenet poster
 
Posts: 1
Default excel97: filtering out the zeros macro

Sorry... misunderstood what you were trying to do. Attempt #2:

sub HideEmptyRows

Dim Col as integer
Dim Row as integer
Dim CountingValue as integer

range(cells(1,1),cells(100,1)).entirerow.hidden = false
For row = 1 to 100
col = 2
for col = 2 to 100 '(since column A contains the account number, it i
not included)
Countingvalue = countingvalue +trim$(cells(row,col).value)
next col
if countingvalue = 0 then
cells(row,1).entirerow.hidden = true
else countingvalue = 0
end if
Next row

end sub


When using this script, make sure that all cells within the range (th
row / col statements) contain a value (more specifically, a integer)
otherwise the trim$(cells(row,col).value) statement will generate a
error

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