Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Inputting Dates Formula?

Is there anyway to input a date in a cell when data first appears in another
cell? For instance, if I entered data in cell A1, is there a way that B1
will record that date, but not change it the next day?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Inputting Dates Formula?

You may be able to use a macro to enter the time/date so that it doesn't change.

Take a look at JE McGimpsey's site:
http://www.mcgimpsey.com/excel/timestamp.html

Scott wrote:

Is there anyway to input a date in a cell when data first appears in another
cell? For instance, if I entered data in cell A1, is there a way that B1
will record that date, but not change it the next day?

Thanks!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Inputting Dates Formula?

You could use an event macro. Say we want to record in column B the data
when entry is made in column A. Insert the following event macro in the
worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range
Set A = Range("A:A")
If Intersect(A, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Offset(0, 1).Value = Date
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu201001


"Scott" wrote:

Is there anyway to input a date in a cell when data first appears in another
cell? For instance, if I entered data in cell A1, is there a way that B1
will record that date, but not change it the next day?

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Inputting Dates Formula?

Gary,
Yes, this does work. However, how do I change the destination cell for the
date to appear on? For instance, what do I do if I want it to display in
Column W? How do I edit your code?



"Gary''s Student" wrote:

You could use an event macro. Say we want to record in column B the data
when entry is made in column A. Insert the following event macro in the
worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range
Set A = Range("A:A")
If Intersect(A, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Offset(0, 1).Value = Date
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu201001


"Scott" wrote:

Is there anyway to input a date in a cell when data first appears in another
cell? For instance, if I entered data in cell A1, is there a way that B1
will record that date, but not change it the next day?

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Inputting Dates Formula?

First thanks for trying a macro solution. (many folks have "macrophobia").
To use W instead of B change:
Target.Offset(0, 1).Value = Date
into:
Target.Offset(0, 22).Value = Date

You see 1 is for B
2 is for C


etc.
--
Gary''s Student - gsnu201001


"Scott" wrote:

Gary,
Yes, this does work. However, how do I change the destination cell for the
date to appear on? For instance, what do I do if I want it to display in
Column W? How do I edit your code?



"Gary''s Student" wrote:

You could use an event macro. Say we want to record in column B the data
when entry is made in column A. Insert the following event macro in the
worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range
Set A = Range("A:A")
If Intersect(A, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Offset(0, 1).Value = Date
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu201001


"Scott" wrote:

Is there anyway to input a date in a cell when data first appears in another
cell? For instance, if I entered data in cell A1, is there a way that B1
will record that date, but not change it the next day?

Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Inputting Dates Formula?

Ok, I figured that out. Actually I figured out how to change that shortly
after I posted my reply.

But one more question. What if I wanted to substitute something as the
match results? For instance, what happens if I want to display the date in
B1 when A1 equals "Complete." Also, if/when A1 changes and does not match or
text is deleted, I would want to clear the date in B1.



"Gary''s Student" wrote:

First thanks for trying a macro solution. (many folks have "macrophobia").
To use W instead of B change:
Target.Offset(0, 1).Value = Date
into:
Target.Offset(0, 22).Value = Date

You see 1 is for B
2 is for C


etc.
--
Gary''s Student - gsnu201001


"Scott" wrote:

Gary,
Yes, this does work. However, how do I change the destination cell for the
date to appear on? For instance, what do I do if I want it to display in
Column W? How do I edit your code?



"Gary''s Student" wrote:

You could use an event macro. Say we want to record in column B the data
when entry is made in column A. Insert the following event macro in the
worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range
Set A = Range("A:A")
If Intersect(A, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Offset(0, 1).Value = Date
Application.EnableEvents = True
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu201001


"Scott" wrote:

Is there anyway to input a date in a cell when data first appears in another
cell? For instance, if I entered data in cell A1, is there a way that B1
will record that date, but not change it the next day?

Thanks!

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
help with inputting code Morgan New Users to Excel 3 February 26th 10 12:24 AM
Cell not available when inputting formula Lyn Excel Worksheet Functions 2 April 14th 09 06:38 PM
Inputting date as dd/mm not mm/dd MichaelH Excel Discussion (Misc queries) 2 May 26th 07 11:42 AM
inputting data Shanor Excel Discussion (Misc queries) 0 June 15th 06 10:50 AM
Inputting SAME formula within EVERY (ALL) Worksheet FLKULCHAR Excel Worksheet Functions 1 September 30th 05 07:13 PM


All times are GMT +1. The time now is 09:44 AM.

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"