Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use a loop to hide rows

Status
Not open for further replies.

pawnman

MIS
May 19, 2003
10
US
I'm sure this is a simple matter, but I am struggling with it. Basically, I want the program to loop through a single column, like this (Pseudo code):

dim count as integer
count = 1

do until EOD
if hcount = ""
select whole row
hide whole row
end if

increment count

loop

End program.

Any help would be appreciated. I don't think I'm referencing the cell values properly. It's been so long since my VB class in college, and we never did VBA.
 
if hcount = ""
What is supposed to be hcount ?
Why not consider AutoFilter (if Excel)?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
hcount is a single cell. Column h, row count. When count increments, it will run the program through all the rows, looking for a value in column H. At least, that's the plan.
 
No need of VBA.
Select the entire column H, menu Data -> Filter -> Auto filter.
Drill down the filtering list in column H and choose: (not empty)
If you insists for VBA, just use the macro recorder.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top