How to pick date and month?

R

Ratheesh

Hi All -

Could you please help me on this?

In a worksheet "A" column containing birthdays(date, dd/mm/yyyy). How
can I write a code to show date & month("A" column) matching with
todays date & month in the respective "B" column.?

Thanks a lot in advance for your helps...
Ratheesh
 
F

fisch4bill

Hi Ratheesh,

You don't really need any code for this, a simple formula will work as I
understand your question. Try this: =IF(A1=TODAY(),A1,"")

Enter this into cell B1 and copy it down the rows that you need it. It will
display the date in the same row of Column B as the date in Column A that
matches the current date, and an empty looking cell when the date in A does
not match the current date.

HTH
Bill
 
R

Ratheesh

Hi Ratheesh,

You don't really need any code for this, a simple formula will work as I
understand your question. Try this:  =IF(A1=TODAY(),A1,"")

Enter this into cell B1 and copy it down the rows that you need it. It will
display the date in the same row of Column B as the date in Column A that
matches the current date, and an empty looking cell when the date in A does
not match the current date.

HTH
Bill








- Show quoted text -

No it will not work... it will work only the date is today (i.e,
today() = today's date, suppose, today is 24/02/2010, this will show
there, but I need only date and month, ie, if 24/02/1980 or 24/02/1981
this all should come in B column... as per your code 24.02/2010 only
will come in B column. could you please try once again...
 
J

Jef Gorbach

Enter this formula in column(B), format it custom(dd,mm) since you
want 2/22/2010 to show as 22,02 then autofill your range.

=IF(MONTH(A2)=MONTH(TODAY()),A2,"")

alternately if you wanted VBA code
Sub test()
For Row = 2 To Range("A65536").End(xlUp).Row
If Month(Cells(Row, 1).Value) = Month(Now) Then Cells(Row,
2).Value = Cells(Row, 1).Value
Next
Columns(2).NumberFormat = "dd,mm"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top