Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Today's Date in a List-- How?
I'm totally new to this and need help desperately. I have a value in cell A1 that I have to file away. Column C contains a list of all the dates of the year. I need a macro that will check what today's date is, find that date in Column C and copy the contents of cell A1 into the cell immediately to the right of today's date (Column D). I haven't written a macro since I used Visicalc. Your help & patience is most appreciated! ~ Gary -- GaryCam ------------------------------------------------------------------------ GaryCam's Profile: http://www.excelforum.com/member.php...o&userid=32330 View this thread: http://www.excelforum.com/showthread...hreadid=520880 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Today's Date in a List-- How?
This little macro will search Column C for today's date and copy A1 to the
cell to the right of today's date . Note that the code is getting today's date from the system date of your computer so make sure you have the right date set in your computer. Note that there is no error trap in this macro so you must have today's date listed in Column C. HTH Otto Sub FindDate() Dim TheRng As Range Set TheRng = Range("C1", Range("C" & Rows.Count).End(xlUp)) TheRng.Find(What:=Date, LookAt:=xlWhole).Offset(, 1).Value = Range("A1").Value End Sub "GaryCam" wrote in message ... I'm totally new to this and need help desperately. I have a value in cell A1 that I have to file away. Column C contains a list of all the dates of the year. I need a macro that will check what today's date is, find that date in Column C and copy the contents of cell A1 into the cell immediately to the right of today's date (Column D). I haven't written a macro since I used Visicalc. Your help & patience is most appreciated! ~ Gary -- GaryCam ------------------------------------------------------------------------ GaryCam's Profile: http://www.excelforum.com/member.php...o&userid=32330 View this thread: http://www.excelforum.com/showthread...hreadid=520880 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Today's Date in a List-- How?
Thanks, Otto. Unfortunately when I run this one I get a Systex Error on the following line: TheRng.Find(What:=Date, LookAt:=xlWhole).Offset(, 1).Value = What am I doing wrong? Thanks again, Gary -- GaryCam ------------------------------------------------------------------------ GaryCam's Profile: http://www.excelforum.com/member.php...o&userid=32330 View this thread: http://www.excelforum.com/showthread...hreadid=520880 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Today's Date in a List-- How?
Gary
You are the victim of line wrapping in these messages. The line that follows the line you cited: Range("A1").Value belongs at the end of the line you cited. HTH Otto "GaryCam" wrote in message ... Thanks, Otto. Unfortunately when I run this one I get a Systex Error on the following line: TheRng.Find(What:=Date, LookAt:=xlWhole).Offset(, 1).Value = What am I doing wrong? Thanks again, Gary -- GaryCam ------------------------------------------------------------------------ GaryCam's Profile: http://www.excelforum.com/member.php...o&userid=32330 View this thread: http://www.excelforum.com/showthread...hreadid=520880 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Today's Date in a List-- How?
OK, I eliminated the word wrap problem. Now I get the following error message: Run-time Error '91': Object varaible or With block variable not set Does it matter that cell A1 contains a formula? All I need filed next to today's date is the resultant value that appears in A1? ~ Gary -- GaryCam ------------------------------------------------------------------------ GaryCam's Profile: http://www.excelforum.com/member.php...o&userid=32330 View this thread: http://www.excelforum.com/showthread...hreadid=520880 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Today's Date in a List-- How?
Gary
That macro works for me just fine. Tell me what version of excel you are running. Also send me, direct via email, the file in which you are using this macro. My email address is . Remove the "nop" from this address. Otto "GaryCam" wrote in message ... OK, I eliminated the word wrap problem. Now I get the following error message: Run-time Error '91': Object varaible or With block variable not set Does it matter that cell A1 contains a formula? All I need filed next to today's date is the resultant value that appears in A1? ~ Gary -- GaryCam ------------------------------------------------------------------------ GaryCam's Profile: http://www.excelforum.com/member.php...o&userid=32330 View this thread: http://www.excelforum.com/showthread...hreadid=520880 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
create button to find today's date in another tab | Excel Worksheet Functions | |||
find cell with today's date | Excel Discussion (Misc queries) | |||
Find and display today's date cel | Excel Programming |