Unhide Row when workbook is opened

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello I have a daily report and each day I add the results for the
previous day then I send out the report. Each line is for a day- ( e.g.
Oct 18 2007) So I have rows with dates until the end of the year 2007 .(
THere are formulas in the rows to calculate results) What I do is unhide
the rows everyday enter the information then hide the other rows. So when
you view the report the only rows that show are the ones with information.
Is there a way to unhide the next row when I open the workbook everyday I
have excel 2002 thanks
 
put this into a workbook_open event in the ThisWorkbook module.

'if a row certain each time
Sheets("sheet8").Rows(16).Hidden = False
'or if rows below last entry are hidden
'sheets("sheet8").Rows(Cells(Rows.Count, "a").End(xlUp).Row + 1).Hidden =
False
 
Thank you but I really do not understand the instructions . I right click
then selected view code - selected this workbook - then I was lost - I
understand that I should change ("sheet8") to the name of my worksheet
Please rephrase I'm a novice at this thanks
 
Hello Again
below is my code - exactly- but when I open the workbook I get the following
error message Run time error 9 subscript out of range when I select
debug the line that starts with Sheets("Daily Report") is highlighted in
yellow thank you for your patience and understanding

Private Sub Workbook_Open()
'if a row certain each time
'heets("sheet8").Rows(16).Hidden = False
'or if rows below last entry are hidden
Sheets("Daily Report").Rows(Cells(Rows.Count, "a").End(xlUp).Row + 1).Hidden
= False

End Sub
 
My error in not defining the last row. Notice the one dot before rows in
each case.

Private Sub Workbook_Open()
with Sheets("Daily Report")
.Rows(Cells(.Rows.Count, "a").End(xlUp).Row + 1).Hidden =false
end with
End Sub
 
One more dot:

..Rows(.Cells(.Rows.Count, "a").End(xlUp).Row + 1).Hidden = false
(added before the Cells() part)
 

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

Back
Top