I was able to create a macro on how to find the value in a cell and then hide that row with 2 rows above but my problem is continuing to do it until all values are found with the rows hidden. How will a loop know when to stop. I was able to use a do - loop for find and then the formula to place the value "yes" in an adjacent cell using the first find address. But when you are hiding rows it will not find that address now.
I know I have got to be close but I guess I've been working on this too long!!! Can someone please help me figure out how to make the code below work so that it does the following for each "yes" found? I am leaving the Do - loop stuff out in case you have a better/easier way to do this. Thank you so much in advance!
Shelly
I know I have got to be close but I guess I've been working on this too long!!! Can someone please help me figure out how to make the code below work so that it does the following for each "yes" found? I am leaving the Do - loop stuff out in case you have a better/easier way to do this. Thank you so much in advance!
Code:
'
ActiveCell.Offset(-1, 0).Range("A1").Select
Cells.Find(What:="yes", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.Offset(-1, 0).Rows("1:2").EntireRow.Select
ActiveCell.Activate
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Range("A1").Select
Shelly
Last edited by a moderator: