PDA

Click to See Complete Forum and Search --> : Clear Content Scripts??


rikinel
Jul 30th, 2005, 09:04 PM
Hi everyone,
would you like to help me??

In sheet 1, I must find the word "POPULATION",after that I must clear content all row below until row 99 because in row 100 the word "AVERAGE" is not allowed to be cleared/deleted. How to make clear content process stop automatically when it reach row 99. How to make by DO WHILE LOOP, FOR NEXT or any other solutions because I am a beginner in VBA.

And so on until sheet 10
Thank your for your suggestion :ehh:

dannymking
Jul 31st, 2005, 05:00 AM
Hi and Welcome,

I Take it you know which column this will appear?? And are you wanting the information removing, or the entire row?


'Set the cell below population
Do While ActiveCell.Row < 99
ActiveCell.EntireRow.Clear
ActiveCell.OffSet(1,0).Select
Loop


Or


Range("A2").Select
Do While ActiveCell.Value <> "AVERAGE"
ActiveCell.EntireRow.Delete
Loop


However with the second one you will need to know the exact cell the word AVERAGE will appear in, and also move the cursor below the row containing POPULATION.

To loop around the sheets do


Dim i As Integer
For i = 1 to 10
Sheets(i).Activate
'loop around Cells here
Next i