offset/macro problem

  • Thread starter Thread starter maacmaac
  • Start date Start date
M

maacmaac

I want to hide certain rows given a certain value. I.E. if a user
enters a value of 3 securities, I want to hide rows 14-40. If a user
enters a value of 6 securities, I want to hide rows 17-40.

I have tried to write a macro using the offset button, but cannot get
it to work.

Any help? See attached file.

Thanks.

Sub HideRows()
'
'
'
Rows.Offset("G4+11:40").Select
Range("B14").Activate
Selection.EntireRow.Hidden = True
Range("B3").Select
End Sub

Attachment filename: loop.macro.problem.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=382425
 
Mac,

Try

Sub HideRows()
'
'
'
Rows.Offset("A14:A40").EntireRow.Hidden = True
End Sub

Just add the test for the n um and add a line for 17-40


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top