Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

macro help

Oct 26, 2004 12:59AM PDT

I want to create a macro in excel which when assigned to a button, will unhide a row. The row which needs to be unhidden will change depending if the row above it has a value in the first cell of that row. If that is the case, I need the macro to unhide the next row. Does anyone know how to do that?

Discussion is locked

- Collapse -
Re: macro help
Oct 26, 2004 2:07AM PDT

JSteinmetz,

It's rather simple. Loop from A1 downwards until you find a cell with that particular value. Then go down one more line and unhide it (or possibly: select line and line below it and unhide).

I won't provide code, but it's not especially difficult.

The best thing to do: buy an introductory book on VBA programming in Excel.
Or: Find VBA code and examples on the net (easy to find with google, search for Excel VBA unhide row for example) and study the VBA Help that comes with Excel.
I always advice the first to start with and only turn to the Internet once you've mastered the basics of VBA programming, but you might prefer the other way.

Kees

- Collapse -
Re: macro help
Oct 26, 2004 6:32AM PDT

Thanks for your help. I figured it out.

- Collapse -
(NT) (NT) Good work.
Oct 26, 2004 6:55AM PDT