Thread: Do while
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
okrob okrob is offline
external usenet poster
 
Posts: 142
Default Do while

I've had a brain fart.
Can't remember how to save the initial cell to a variable
and do something while the first cell is NOT active.
Using Excel 2003...

Dim firstcell As Range ' this section is where my problem is...
ActiveCell = firstcell ' It won't save anything to firstcell

Cells.FindNext(After:=ActiveCell).Activate
ActiveCell.Offset(0, 0).EntireRow.Insert Shift:=xlDown
Do While ActiveCell Is Not firstcell
Cells.FindNext(After:=ActiveCell).Activate
Cells.FindNext(After:=ActiveCell).Activate
ActiveCell.Offset(0, 0).EntireRow.Insert Shift:=xlDown
Loop