Results 1 to 5 of 5

What's wrong with my loop ?

Threaded View

Grek What's wrong with my loop ? 12-12-2006, 02:14 PM
mudraker Greg When I ran you the... 12-12-2006, 05:36 PM
peejay the following code will loop... 12-12-2006, 05:50 PM
peejay Try this Code 12-12-2006, 06:16 PM
Grek Thanks a lot for your help... 12-13-2006, 02:23 PM
  1. #1
    Registered User
    Join Date
    04-29-2004
    Posts
    11

    What's wrong with my loop ?

    Hi,

    I have a problem with the macro that I have done.
    I would like it to stop when the value of the cell = "END" but it doens't work. The macro never stops running.

    Could you please have a look at the problem and tell me what's wrong ? I assume that there is also a better solution that all the loops that I've done... ?

    Thanks for your help,

    Greg

    Sub UpdateChecks()
    '
    ' UpdateChecks Macro
    ' Macro recorded 12/12/2006 by
    '
    
    '
    
        Sheets("AAA CHECKS").Select
        VarName = Range("D6").Value
        Range("B19").Select
        
        
        Sheets("FULL").Select
        Range("A3").Select
        
        'Do Until ActiveCell.Value = "END"
        
        
        Do Until ActiveCell.Value = VarName
        ActiveCell.Offset(0, 1).Activate
        Loop
        
        Do Until ActiveCell.Value = "END"
        
        
        Do Until ActiveCell.Value = "x"
        ActiveCell.Offset(1, 0).Activate
        Loop
        VarDescription = ActiveCell.Offset(0, -3).Value
        VarFrequency = ActiveCell.Offset(0, -2).Value
        VarPeriod = ActiveCell.Offset(0, -1).Value
        
        Sheets("AAA CHECKS").Select
        ActiveCell.Value = VarDescription
        ActiveCell.Offset(0, 1).Value = VarFrequency
        ActiveCell.Offset(0, 2).Value = VarPeriod
        ActiveCell.Offset(1, 0).Activate
        
        Sheets("FULL").Select
        ActiveCell.Offset(1, 0).Activate
        Loop
        
        
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1