Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
create button to find today's date in another tab kjedgar65 Excel Worksheet Functions 1 March 22nd 09 09:14 AM
find cell with today's date James D Excel Discussion (Misc queries) 2 January 16th 06 09:59 PM
Find and display today's date cel awander Excel Programming 3 May 24th 04 05:49 PM


All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"