Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
hme hme is offline
external usenet poster
 
Posts: 1
Default Date distinguish


Hi every body

How does excel destinguish what date is today?

I use Excel as a scheduling program.
I have my daily schedule In *sheet1* with the the tasks and the the
duration (Start date and finish date)

I would like to have a macro to be able to distinguish what date is
today and copy all the tasks which are planned just for today in sheet1
(in Colomn A) and past them in column A in sheet2.For e.g. I would like
to see the tasks for 01/05/2006 in another sheet.

Thk
hme


--
hme
------------------------------------------------------------------------
hme's Profile: http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=537674

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Date distinguish

Today's date is the Date function in VBA, so you would just do something
like

For this_row = 1 To last_row_number
If Cells(this_row,"A").Value = Date Then
j = j + 1
Cells(this_row,"A").Copy Worksheets("Sheet2").Range("A" & j)
End If
Next this_row

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"hme" wrote in message
...

Hi every body

How does excel destinguish what date is today?

I use Excel as a scheduling program.
I have my daily schedule In *sheet1* with the the tasks and the the
duration (Start date and finish date)

I would like to have a macro to be able to distinguish what date is
today and copy all the tasks which are planned just for today in sheet1
(in Colomn A) and past them in column A in sheet2.For e.g. I would like
to see the tasks for 01/05/2006 in another sheet.

Thk
hme


--
hme
------------------------------------------------------------------------
hme's Profile:

http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=537674



  #3   Report Post  
Posted to microsoft.public.excel.programming
hme hme is offline
external usenet poster
 
Posts: 1
Default Date distinguish


Thank for prompt reply

I did not understand.

Requester Macro should find today date in sheet1 where there is all the
date from 1/1/2006 to 31/12/2006 and correspond task.

Later the task shoud be copy to sheet2.

thk

hme


--
hme
------------------------------------------------------------------------
hme's Profile: http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=537674

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Date distinguish

Sub CopyData()
Dim this_row As Long
Dim last_row_number As Long
Dim start_date As Date
Dim end_date As Date
Dim j As Long

start_date = DateSerial(2006, 1, 1)
end_date = DateSerial(2006, 12, 31)
last_row_number = Cells(Rows.Count, "A").End(xlUp).Row
For this_row = 1 To last_row_number
If Cells(this_row, "A").Value = start_date And _
Cells(this_row, "A").Value <= end_date Then
j = j + 1
Rows(this_row).Copy Worksheets("Sheet2").Range("A" & j)
End If
Next this_row
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"hme" wrote in message
...

Thank for prompt reply

I did not understand.

Requester Macro should find today date in sheet1 where there is all the
date from 1/1/2006 to 31/12/2006 and correspond task.

Later the task shoud be copy to sheet2.

thk

hme


--
hme
------------------------------------------------------------------------
hme's Profile:

http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=537674



  #5   Report Post  
Posted to microsoft.public.excel.programming
hme hme is offline
external usenet poster
 
Posts: 1
Default Date distinguish


Thanks Bob

I tried what you suggested and it is working very well.

Thanks again
hm

--
hm
-----------------------------------------------------------------------
hme's Profile: http://www.excelforum.com/member.php...fo&userid=1593
View this thread: http://www.excelforum.com/showthread.php?threadid=53767

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
Possible to distinguish uppercase from lowercase text? seed Excel Discussion (Misc queries) 5 February 28th 09 04:07 PM
CF to distinguish Formulas from Inputs Brian Ballek Excel Worksheet Functions 7 August 7th 07 01:37 AM
how to distinguish between text cells? phaidon New Users to Excel 2 April 12th 06 09:42 AM
How to distinguish the method Excel was opened? 43N79W Excel Programming 0 September 6th 04 12:31 AM
Help with inputbox (Distinguish OK from Cancel) NooK[_47_] Excel Programming 3 August 5th 04 11:45 AM


All times are GMT +1. The time now is 03:19 PM.

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

About Us

"It's about Microsoft Excel"