Hide Rows

G

Guest

I have a workbook that performs financial calculations on information
provided from another department. The calculations work wonderfully and the
formatting is good. However, in order to keep the workbook flexible, it is
preset to calculate up to 50 years worth of information. We will rarely
require that much information. I need a way to automatically hide the
information for the remaining years for presentation sake. So say we need a
ten year calculation, I need to hide rows 11 through 50. I'm just not sure
how to go about handling it. Manually it is simple to hide or change the font
but I need it to be completely automated. Any ideas or suggestions? I can
post more information if necessary.
 
G

Guest

Will this 10-year calculation be a fixed number of periods you want to see,
or you want it to be flexible depending on how many years of data you want to
see?

You could always incorporate an inputbox that prompts from a worksheet
button. The user could input the number of years of data to be visible and
the remaining data could be hiden using code.

Hope this helps,
Chad
 
D

Don Guillett

try this idea.
Sub hidevariablerows()
Rows("2:50").Hidden = True
numrows = InputBox("Enter number of rows to show")
Rows("1:" & numrows).Hidden = False
End Sub
 
G

Guest

I want it to remain flexible. On another sheet in the workbook, there is a
cell where the number of years will be entered. I need the results sheet to
reference that cell and hide the unnecessary years. The number of years is
rarely the same twice. I could theoretically use a button next to the input
cell but I need help on what code to put behind it. Thanks for your help. Let
me know your ideas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top