Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I'd like to create a macro which selects the cell in a column which
is equal to Today() or the next date following. I have set up a task list in Excel and Column C has a list of historical and future dates. As I'm a novice, can anyone assist in providing a macro to be this? I am playing around with the 'nextrow' argument but not getting anywhere. thanks Nelson |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe...
Option Explicit Sub testme02() Dim wks As Worksheet Dim myCol As Range Dim res As Variant Dim FirstDate As Long Set wks = ActiveSheet Set myCol = wks.Range("C1").EntireColumn FirstDate = CLng(Date) res = Application.Match(FirstDate, myCol, 0) If IsError(res) Then res = Application.Match(FirstDate + 1, myCol, 0) End If If IsError(res) Then MsgBox "Today and Tomorrow weren't found!" Else myCol.Cells(1)(res).Select End If End Sub wrote: Hi, I'd like to create a macro which selects the cell in a column which is equal to Today() or the next date following. I have set up a task list in Excel and Column C has a list of historical and future dates. As I'm a novice, can anyone assist in providing a macro to be this? I am playing around with the 'nextrow' argument but not getting anywhere. thanks Nelson -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range, res as Variant, res1 as Variant
set rng = Range(Cells(1,1),Cells(1,1).End(xldown)) res = application.Match(clng(date),rng,0) res1 = application.Match(clng(date + 1),rng,0) if not iserror(res) then rng(res).Select elseif not iserror(res1) then rng(res1).Select else msgbox "Not found" end if -- Regards, Tom Ogilvy wrote in message ps.com... Hi, I'd like to create a macro which selects the cell in a column which is equal to Today() or the next date following. I have set up a task list in Excel and Column C has a list of historical and future dates. As I'm a novice, can anyone assist in providing a macro to be this? I am playing around with the 'nextrow' argument but not getting anywhere. thanks Nelson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
display date of today in cell X when number 0 in cell Y | Excel Worksheet Functions | |||
Populate Cell with another cell, but only if the date equals today | Excel Worksheet Functions | |||
IF TODAY equals date in cell A10, or if TODAY is beyond that date | Excel Worksheet Functions | |||
Addition to Turn cell red if today is greater or equal to date in cell | New Users to Excel | |||
Turn cell red if today is greater or equal to date in cell | New Users to Excel |