Thanx Asa,

 

 

 

________________________________

From: excel-macros@googlegroups.com
[mailto:excel-macros@googlegroups.com] On Behalf Of Asa Rossoff
Sent: Tuesday, February 28, 2012 8:09 AM
To: excel-macros@googlegroups.com
Subject: RE: $$Excel-Macros$$ If I input Letter Y is should show the
current date.......(28-Feb-2012) like this......

 

Hello Mohammed,

 

Not without using VBA.

 

Several people have asked similar questions recently.  It is possible to
do this using VBA macros, but I would suggest using the CTRL-; keyboard
shortcut to enter the current date instead.

 

A simple formula using DATE() will not work because it will be
recalculated frequently, and will use the current date each day.

 

For your solution, you could use a Worksheet_Change event like this:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim rng As Range, cell As Range

    

    ' SUPPLY DATE FOR COLUMN A WHEN "Y" ENTERED IN COLUMN B.

    ' Identify changed cells in column B.

    Set rng = Application.Intersect(Me.Range("B:B"), Target)

    ' if cells were identified...

    If Not rng Is Nothing Then

        For Each cell In rng

            If UCase(cell.Value2) = "Y" Then

                ' disable events to avoid another worksheet_change event

                Application.EnableEvents = False

                cell.Value2 = Empty

                Application.EnableEvents = True

                cell.Offset(, -1).Value = Date

            End If

        Next cell

    End If

 

End Sub

Asa

 

From: excel-macros@googlegroups.com
[mailto:excel-macros@googlegroups.com] On Behalf Of Mohammed Muneer
Sent: Monday, February 27, 2012 7:55 PM
To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ If I input Letter Y is should show the current
date.......(28-Feb-2012) like this......

 

Dear Friends have a nice day,

 

I have a small question.

 

For example, I have two cols A and B as shown below one is for date &
the other have letter "Y".

 

        A                      B

 

28-feb-2012               Y

 

Can I do it like this? If I input letter "Y" in the column B I can
display the current date.

 

Regards,

Muneer,

CC...

            

 

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
will not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook.
Forum owners and members are not responsible for any loss.
 
------------------------------------------------------------------------
------------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
will not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook.
Forum owners and members are not responsible for any loss.
 
------------------------------------------------------------------------
------------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to