Do while

O

okrob

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
 
B

Bob Phillips

Set firstCell = Activecell


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
O

okrob

Set firstCell = Activecell

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)








- Show quoted text -

knew it was a simple brain fart.
Thanks Bob...
 

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