Macro help needed

J

James

I am looking to set up a macro to unhide a new row every time a button is
clicked.

I have set up a macro that opens up a new row, but it doesn't add any rows
after that.

Private Sub CommandButton1_Click()
'
' Add_New_Project Macro
' Macro recorded 22/02/2008 by
'
'
ActiveWindow.SmallScroll Down:=5
ActiveSheet.Shapes("CommandButton1").Select
ActiveWindow.SmallScroll Down:=-75
Rows("2:99").Select
Range("A99").Activate
Selection.EntireRow.Hidden = False
Rows("3:97").Select
Range("A97").Activate
Selection.EntireRow.Hidden = True
End Sub

Could anyone help with this?
 
D

Don Guillett

Guessing here but if you want to unhide the last row and hide 2 rows above

sub unhide row()
lr=cells(rows.count,"a").end(xlup).row
rows(lr).hidden=false
rows(lr-2).hidden=true
end sub
 

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