"Do While" issue (1 Viewer)

proballin

Registered User.
Local time
Today, 16:55
Joined
Feb 18, 2008
Messages
105
The code below works fine as far as putting the right things in each cell. However the code just continues to loop and never exits. Is the first line in my code correct?


Code:
     Do While Cells(i, 1).value = "Chicago"
                  Cells(i, 4).Select
                  Selection.Copy
                  Sheets("Chicago").Select
                  Cells(a, g).Select
                  ActiveSheet.Paste
                  i = i + 1
                  g = g + 1
                  Sheets("Status_Report_SUM").Select
              Loop
 

ajetrumpet

Banned
Local time
Today, 16:55
Joined
Jun 22, 2007
Messages
5,638
maybe you've broken a rule. maybe this:
PHP:
do while cells(a, b) = something
really tells the program this:

"remember the value in cells(a, b) when this loop starts"
"run this until that value changes"


if that's really what's happening, that's why its not stopping. value doesn't change. :)

either that...or there's an unwritten rule between switching back and forth between pages like you're doing.
 

proballin

Registered User.
Local time
Today, 16:55
Joined
Feb 18, 2008
Messages
105
That looks to have solved the problem. I just took off the ".value" off of Cells(i, 1). Thanks!
 

Users who are viewing this thread

Top Bottom