#1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Do while

Set firstCell = Activecell


--
---
HTH

Bob

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



"okrob" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Do while

On Oct 4, 11:20 am, "Bob Phillips" wrote:
Set firstCell = Activecell

--
---
HTH

Bob

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

"okrob" wrote in message

ups.com...



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- Hide quoted text -


- Show quoted text -


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"