Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109918

Re: help with loop code

From Claus Busch <claus_busch@t-online.de>
Newsgroups microsoft.public.excel.programming
Subject Re: help with loop code
Date 2017-03-15 16:05 +0100
Organization A noiseless patient Spider
Message-ID <oabl27$79n$1@dont-email.me> (permalink)
References <eltyar.130f09d8@excelbanter.com>

Show all headers | View raw


Hi,

Am Wed, 15 Mar 2017 14:24:06 +0000 schrieb eltyar:

> please how can i say in this code... do it when you see "ok" in cells of
> column "P" and if any empty cells ignore it and continue?
> 
> this is the Code:
> 
> I = I + 1
> Cells(1, "J").Value = "Outlook sent Time,Dynamic msg preview  count  ="
> & I - 3
> Loop While Cells(I, "P").Value = "ok"

try:

Sub Test()
Dim LRow As Long
Dim i As Long, j As Long
j = 1
With ActiveSheet
    LRow = .UsedRange.Rows.Count
    For i = 1 To LRow
        If .Cells(i, "P") = "ok" Then
            .Cells(i, "J") = _
            "Outlook sent Time,Dynamic msg preview  count  =" & j - 3
            j = j + 1
        End If
    Next
End With
End Sub


Regards
Claus B.
-- 
Windows10
Office 2016

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

help with loop code eltyar <eltyar.130f09d8@excelbanter.com> - 2017-03-15 14:24 +0000
  Re: help with loop code Claus Busch <claus_busch@t-online.de> - 2017-03-15 16:05 +0100
    Re: help with loop code eltyar <eltyar.130fead8@excelbanter.com> - 2017-03-16 06:43 +0000

csiph-web