+ Reply to Thread
Results 1 to 6 of 6

Skip row in For...Next loop to automate e-mails

Hybrid View

Bonnister Skip row in For...Next loop... 08-15-2013, 06:56 AM
ARGK Re: Skip row in For...Next... 08-15-2013, 07:06 AM
Richard Buttrey Re: Skip row in For...Next... 08-15-2013, 08:26 AM
Norie Kenny A simple If should... 08-15-2013, 07:07 AM
Richard Buttrey Re: Skip row in For...Next... 08-15-2013, 07:10 AM
Bonnister Re: Skip row in For...Next... 08-15-2013, 07:57 AM
  1. #1
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Skip row in For...Next loop to automate e-mails

    Hi,

    Sub Check_Tasks()
    
        Dim lastRow As Long, r As Long
    
        With Sheets("todo")
            lastRow = Cells(Rows.Count, "B").End(xlUp).Row
            For r = 5 To lastRow
                If LCase(Cells(r, "I").Value) <> "yes" Then    ' 'Skips when col I doesn't contain a 'Yes'
                    If Cells(r, "E").Value = Date Then Send_Outlook_Email "Task Reminder", .Cells(r, "H").Value, .Cells(r, "G").Value
                    Cells(r, "I").Value = "Yes"
                End If
            Next r
        End With
    
    End Sub
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  2. #2
    Registered User
    Join Date
    03-01-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Skip row in For...Next loop to automate e-mails

    ARGK, Norie and Richard

    Thanks all of you for responding so quickly, I did try adding a 'Next r' to my code but wasn't wrapping that in an 'End If' statement so I feel I was on the right lines at least! Kudos to this forum and it's collection of excellent, informative contributors

    Kenny

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Skip blank cells in a loop
    By k64 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-14-2013, 02:29 PM
  2. Use a loop but skip a row
    By amartino44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2013, 12:26 PM
  3. Using Excel to automate e-mails sent from Outlook?
    By Shelter417 in forum Excel General
    Replies: 3
    Last Post: 02-26-2012, 03:25 PM
  4. How to skip special cases in a For Each loop
    By smohyee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2011, 02:20 PM
  5. [SOLVED] Loop through email address list to send e-mails
    By Paul. in forum Excel General
    Replies: 1
    Last Post: 04-12-2005, 08:06 AM

Tags for this Thread

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