Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:22:13+00:00 2026-06-17T07:22:13+00:00

Currently im working on a database Excel spreadsheet and im currently using VBA to

  • 0

Currently im working on a database Excel spreadsheet and im currently using VBA to implement some automatic functions to the system. Im new to VBA so i need your help 🙂

My question is this: I have a statues column in which the user needs to select from a drop list ‘Complete’ or ‘In progress’. I need a program which can scan a specific column (example S3) for the word ‘Complete’. Once the word is detected, the system will automatically send an email to a specific user tell him that the task has been complete.

Can anyone help me?

Thanks! 🙂

Update: I have coded the following to search for the word complete and send an email to the user (this is a rough idea)

Sub For_Loop_With_Step()

    Dim lCount As Long, lNum As Long
    Dim MyCount As Long

    MyCount = Application.CountA(Range("S:S"))

    For lCount = 1 To MyCount - 1 Step 1
    If Cells(lCount + 2, 19) = "Complete" Then
    Call Send_Email_Using_VBA
    Else
    MsgBox "Nothing found"
    End If

    Next lCount



    MsgBox "The For loop made " & lNum & " loop(s). lNum is equal to " & lNum

End Sub

.

Sub Send_Email_Using_VBA()

    Dim Email_Subject, Email_Send_From, Email_Send_To, _
    Email_Cc, Email_Bcc, Email_Body As String
    Dim Mail_Object, Mail_Single As Variant
    Email_Subject = "Testing Results"
    Email_Send_From = "fromperson@example.com"
    Email_Send_To = "toperson@example.com"
    'Email_Cc = "someone@example.com"
    'Email_Bcc = "someoneelse@example.com"
    Email_Body = "Congratulations!!!! You have successfully sent an e-mail using VBA !!!!"
    On Error GoTo debugs
    Set Mail_Object = CreateObject("Outlook.Application")
    Set Mail_Single = Mail_Object.CreateItem(0)
    With Mail_Single
    .Subject = Email_Subject
    .To = Email_Send_To
    .cc = Email_Cc
    .BCC = Email_Bcc
    .Body = Email_Body
    .send
    End With
    debugs:
    If Err.Description <> "" Then MsgBox Err.Description
End Sub

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:22:15+00:00Added an answer on June 17, 2026 at 7:22 am

    Try this (Tried And Tested)

    Screenshot:

    enter image description here

    Option Explicit
    
    Sub Sample()
        Dim ws As Worksheet
        Dim i As Long, lRow As Long
        Dim ExitLoop As Boolean
        Dim aCell As Range, bCell As Range
    
        '~~> Set this to the relevant sheet
        Set ws = ThisWorkbook.Sheets("Sheet1")
    
        With ws
            '~~> Find the word in the relevant column. 19 is S Column
            Set aCell = .Columns(19).Find(What:="Complete", LookIn:=xlValues, _
                        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                        MatchCase:=False, SearchFormat:=False)
    
            If Not aCell Is Nothing Then
                '~~> Update Col T appropriately
                '~~> This is required so that mail doesn't go for the same row again
                '~~> When you run the macro again
    
                Set bCell = aCell
    
                If Not .Range("T" & aCell.Row).Value = "Mail Sent" Then
                    If SendEmail = True Then
                        .Range("T" & aCell.Row).Value = "Mail Sent"
                    Else
                        .Range("T" & aCell.Row).Value = "Error: Mail Not Sent"
                    End If
                End If
    
                Do While ExitLoop = False
                   Set aCell = .Columns(19).FindNext(After:=aCell)
    
                   If Not aCell Is Nothing Then
                        If aCell.Address = bCell.Address Then Exit Do
    
                        If Not .Range("T" & aCell.Row).Value = "Mail Sent" Then
                            If SendEmail = True Then
                                .Range("T" & aCell.Row).Value = "Mail Sent"
                            Else
                                .Range("T" & aCell.Row).Value = "Error: Mail Not Sent"
                            End If
                        End If
                   Else
                       ExitLoop = True
                   End If
                Loop
            End If
        End With
    End Sub
    
    Function SendEmail() As Boolean
        Dim OutApp As Object, OutMail As Object
    
        On Error GoTo Whoa
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
    
        With OutMail
            .To = "toperson@example.com"
            .Subject = "Testing Results"
            .Body = "Your Message Goes Here"
            .Display
        End With
    
        DoEvents
    
        SendEmail = True
    
    LetsContinue:
        On Error Resume Next
        Set OutMail = Nothing
        Set OutApp = Nothing
        On Error GoTo 0
    
        Exit Function
    Whoa:
        SendEmail = False
        Resume LetsContinue
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on an n-tier system and battling some database performance issues.
I'm currently working on a GIS database project using Manifold Ultimate. I am able
In my application, we are using Spreadsheet::Read to read a excel and perform some
I am currently working on creating the InitialCreate migration for a new database. I
I'm currently working on a wcf service that does some lookups in a database
I am currently working on reading a excel using php and storing those records
I'm currently working on a database with the following requirements: There are accounts of
I am currently working on a database which stores information which allows users to
Case Currently I'm working on database seeding script, executed with sqlcmd . For example
So I'm currently working on a Berkeley database through C, and I ran into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.