Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Getting endless loop on DoUntil

Can someone please tell me what is wrong with this code? This goes into
an endless loop.
What I'm trying to do is more than is shown below. But, I'm just trying
to get the basic part to work before I plug in the rest of the code.
I've stared at it, and looked at other examples here, and I know it's
something simple that I'm overlooking.....
Your help is always appreciated.
J.O.

Sub OlderThanYearList()
'This will go through the list, and find all those records that are
older
'than a year. It will copy those records to the Year Old List file.

Worksheets("Official List").Activate
Application.Goto Reference:="Age"
Selection.End(xlDown).Select

Do Until IsEmpty(ActiveCell)

If ActiveCell.Value 360 Then
ActiveCell.Offset(0, 1).Select
Application.Selection.Value = "Copy"
ActiveCell.Offset(0, -1).Select
Selection.End(xlDown).Select

End If
Loop
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Getting endless loop on DoUntil

Hi,

Have you tried :

Do Until IsEmpty(ActiveCell.Value)

HTH
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Getting endless loop on DoUntil

You only seem to move the activecell if the condition is met, you either
need to move that out of the If ... End If, or have an Else condition.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"excelnut1954" wrote in message
ups.com...
Can someone please tell me what is wrong with this code? This goes into
an endless loop.
What I'm trying to do is more than is shown below. But, I'm just trying
to get the basic part to work before I plug in the rest of the code.
I've stared at it, and looked at other examples here, and I know it's
something simple that I'm overlooking.....
Your help is always appreciated.
J.O.

Sub OlderThanYearList()
'This will go through the list, and find all those records that are
older
'than a year. It will copy those records to the Year Old List file.

Worksheets("Official List").Activate
Application.Goto Reference:="Age"
Selection.End(xlDown).Select

Do Until IsEmpty(ActiveCell)

If ActiveCell.Value 360 Then
ActiveCell.Offset(0, 1).Select
Application.Selection.Value = "Copy"
ActiveCell.Offset(0, -1).Select
Selection.End(xlDown).Select

End If
Loop
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Getting endless loop on DoUntil

Thanks, Bob.
Just not paying attention..... Appreciate the help
J.O.

Bob Phillips wrote:
You only seem to move the activecell if the condition is met, you either
need to move that out of the If ... End If, or have an Else condition.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"excelnut1954" wrote in message
ups.com...
Can someone please tell me what is wrong with this code? This goes into
an endless loop.
What I'm trying to do is more than is shown below. But, I'm just trying
to get the basic part to work before I plug in the rest of the code.
I've stared at it, and looked at other examples here, and I know it's
something simple that I'm overlooking.....
Your help is always appreciated.
J.O.

Sub OlderThanYearList()
'This will go through the list, and find all those records that are
older
'than a year. It will copy those records to the Year Old List file.

Worksheets("Official List").Activate
Application.Goto Reference:="Age"
Selection.End(xlDown).Select

Do Until IsEmpty(ActiveCell)

If ActiveCell.Value 360 Then
ActiveCell.Offset(0, 1).Select
Application.Selection.Value = "Copy"
ActiveCell.Offset(0, -1).Select
Selection.End(xlDown).Select

End If
Loop
End Sub


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Endless loop freddie mac Excel Programming 2 August 1st 06 03:19 PM
endless loop help John Excel Programming 1 October 26th 05 04:51 PM
Endless loop? John Excel Programming 24 August 2nd 05 06:41 PM
deleting rows, endless loop maybe ? dick[_2_] Excel Programming 3 June 28th 05 06:35 PM
Interrupting an endless loop davegb Excel Programming 3 March 17th 05 05:06 PM


All times are GMT +1. The time now is 10:48 PM.

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"