Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Do-Until Loop

$
0
0
I want the following code to execute in each cell until it reaches a named cell called "Stop_RPN_1st_Pass".  I have tried all kinds of Do...Loops but they don't seem to work.  Can anyone return the correct syntax for a Do-Until Loop that looks for a cells name?  I am using VBA for Excel 2010.  I appreciate the help, Bill.

  If ActiveCell.Value < 25 Then
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 5287936
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    ElseIf ActiveCell.Value > 29 Then
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 255
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    Else
        With Selection.Interior
            .Pattern = xlSolid
            .PatternColorIndex = xlAutomatic
            .Color = 65535
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    End If
        ActiveCell.Offset(1, 0).Range("A1").Select


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>