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 7845935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:24:34+00:00 2026-06-02T17:24:34+00:00

I have an excel file of tasks which have either been completed or not,

  • 0

I have an excel file of tasks which have either been completed or not, indicated by a Yes or No in a column. Ultimately I am interested in data in a different column but I want to set up the code so it ignores those rows where the task has been completed. So far I have defined the column range containing the yes/no’s but I don’t know which command to run on this range. I imagine I want to define a new range based on the value in column C.

Option Explicit

Sub Notify()
    Dim Chk As Range
    Dim ChkLRow As Long
    Dim WS1 As Worksheet

    On Error GoTo WhatWentWrong

    Application.ScreenUpdating = False

    '--> If the text in column C is Yes then Ignore (CountIF ?)
    '--> Find last cell in the column, set column C range as "Chk"

    Set WS1 = Sheets("2011")

    With WS1
        ChkLRow = .Range("C" & Rows.Count).End(xlUp).Row
        Set Chk = .Range("C1:C" & ChkLRow)
    End With

    '--> Else Check date in column H
    '--> Count days from that date until today
    '--> Display list in Message Box
Reenter:
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    Exit Sub
WhatWentWrong:
    MsgBox Err.Description
    Resume Reenter
    Application.ScreenUpdating = True
End Sub

Would it perhaps be easier to simply define one range based on the values in column C rather than first defining column C as the range and then redefining it?

Thanks

  • 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-02T17:24:35+00:00Added an answer on June 2, 2026 at 5:24 pm

    Yes Column H has the date the task ‘arrived’ and I want to display a count from then to the current date. The tasks are identified by a 4 digit code in Column A. I envisage the message box saying Task ‘1234’ outstanding for xx days. – Alistair Weir 1 min ago

    Is this what you are trying? Added Col I for visualization purpose. It holds no significance otherwise.

    Option Explicit
    
    Sub Notify()
        Dim WS1 As Worksheet
        Dim Chk As Range, FltrdRange As Range, aCell As Range
        Dim ChkLRow As Long
        Dim msg As String
        On Error GoTo WhatWentWrong
    
        Application.ScreenUpdating = False
    
        Set WS1 = Sheets("2011")
    
        With WS1
            ChkLRow = .Range("C" & Rows.Count).End(xlUp).Row
    
            '~~> Set your relevant range here
            Set Chk = .Range("A1:H" & ChkLRow)
    
            '~~> Remove any filters
            ActiveSheet.AutoFilterMode = False
    
            With Chk
                '~~> Filter,
                .AutoFilter Field:=3, Criteria1:="NO"
                '~~> Offset(to exclude headers)
                Set FltrdRange = .Offset(1, 0).SpecialCells(xlCellTypeVisible)
                '~~> Remove any filters
                ActiveSheet.AutoFilterMode = False
    
                For Each aCell In FltrdRange
                    If aCell.Column = 8 And _
                    Len(Trim(.Range("A" & aCell.Row).Value)) <> 0 And _
                    Len(Trim(aCell.Value)) <> 0 Then
                        msg = msg & vbNewLine & _
                              "Task " & .Range("A" & aCell.Row).Value & _
                              " outstanding for " & _
                              DateDiff("d", aCell.Value, Date) & "days."
                    End If
                Next
            End With
        End With
    
        '~~> Show message
        MsgBox msg
    Reenter:
        Application.ScreenUpdating = True
        Exit Sub
    WhatWentWrong:
        MsgBox Err.Description
        Resume Reenter
    End Sub
    

    SNAPSHOT

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel file with one column which is filled with numbers. I
I have an excel file which is refreshing data every few seconds and running
I have an SSIS package which reads an Excel File (Data Flow Source) and
I have an excel file, validating one column to enter numbers only but it
I have a excel file which is as follows . 1 Kr Veerappan 123
I have an excel file and I want to read each column and create
I have an Excel file that gets external data from database table. I need
I have an excel sheet which has some huge data. Data is organized as
So I have an Excel file with values as 19/09/2011 on a column called
I have a large collection of data in an excel file (and csv files).

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.