Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Inserting current date

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Inserting current date

Hi,

If b25 updates with a macro then the same code should be used to populate
d25 like this

Range("B25").Value = "Somevalue"
Range("D25").Value = Date

Mike

"pdaws" wrote:

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 69
Default Inserting current date

Hi Pdaws,

As you have already macro to populate cell b25 ,edit that macro with
adding following statement.
Range("d25").FormulaR1C1 = "=TODAY()"
Range("d25").Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False


H S Shastri

India

================================================== =========
"pdaws" wrote:

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default Inserting current date

http://www.mcgimpsey.com/excel/timestamp.html

--


Regards,


Peo Sjoblom

"pdaws" wrote in message
...
Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25.
I
would also like for that date to remain constant and not change when
someone
opens the form. Is it possible to create a macro to perform this function
or
is there a formula that I can put in cell d25?

Thanks for your help.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Inserting current date

Thank you HS Shastri,

I used the code and it did populate the current date however I received the
following error message - run time error '438' "Object doesn't support this
property or method". I put the code you gave me at the end of the current
macro. Also the "Selection.PasteSpecial Paste:=xlPasteValues" part of the
code was highlighted in yellow. How do I fix this error?

"HARSHAWARDHAN. S .SHASTRI" wrote:

Hi Pdaws,

As you have already macro to populate cell b25 ,edit that macro with
adding following statement.
Range("d25").FormulaR1C1 = "=TODAY()"
Range("d25").Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False


H S Shastri

India

================================================== =========
"pdaws" wrote:

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Inserting current date

Thank you Mike. I tried the code and it worked. One other question, will
the date remain constant and not change when the form is opened tomorrow?

"Mike H" wrote:

Hi,

If b25 updates with a macro then the same code should be used to populate
d25 like this

Range("B25").Value = "Somevalue"
Range("D25").Value = Date

Mike

"pdaws" wrote:

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Inserting current date

Hi,

the date won't change.

Mike

"pdaws" wrote:

Thank you Mike. I tried the code and it worked. One other question, will
the date remain constant and not change when the form is opened tomorrow?

"Mike H" wrote:

Hi,

If b25 updates with a macro then the same code should be used to populate
d25 like this

Range("B25").Value = "Somevalue"
Range("D25").Value = Date

Mike

"pdaws" wrote:

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 20
Default Inserting current date

Thanks Mike,

One other issue. I receive the following error message when I protect the
form - Run time error '1004' Unable to set the text property of the
characters class.

"Mike H" wrote:

Hi,

the date won't change.

Mike

"pdaws" wrote:

Thank you Mike. I tried the code and it worked. One other question, will
the date remain constant and not change when the form is opened tomorrow?

"Mike H" wrote:

Hi,

If b25 updates with a macro then the same code should be used to populate
d25 like this

Range("B25").Value = "Somevalue"
Range("D25").Value = Date

Mike

"pdaws" wrote:

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Inserting current date

The date will be static until you run the macro tomorrow at which time it
will update.

If you want D25 to remain static you must code for that

If Range"B25").Value = "Somevalue" Then
Range("D25") = Format(Date, "mm/dd/yyy")

Or did you mean datestamp if "any" value is in B25?

In that case Mike's code will do it for you..


Gord Dibben MS Excel MVP

On Wed, 24 Sep 2008 09:45:02 -0700, pdaws
wrote:

Thank you Mike. I tried the code and it worked. One other question, will
the date remain constant and not change when the form is opened tomorrow?

"Mike H" wrote:

Hi,

If b25 updates with a macro then the same code should be used to populate
d25 like this

Range("B25").Value = "Somevalue"
Range("D25").Value = Date

Mike

"pdaws" wrote:

Hi,

When cell b25 is populated by a macro, I would like for cell d25 to
automatically enter the current date based on the population of cell b25. I
would also like for that date to remain constant and not change when someone
opens the form. Is it possible to create a macro to perform this function or
is there a formula that I can put in cell d25?

Thanks for your help.


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
Inserting current date when number entered in cell & Circular reference error? Pheasant Plucker® Excel Discussion (Misc queries) 4 April 10th 07 10:39 AM
Automatically inserting current date in a cell ng66 Excel Discussion (Misc queries) 2 January 31st 07 08:44 PM
Make date change in excel to current date when opening daily? jamie Excel Discussion (Misc queries) 3 March 1st 06 03:37 PM
Can I automatically enter the current date or current time into a Ben New Users to Excel 7 October 19th 05 03:38 PM
Excel 2003 Inserting current date mark Excel Discussion (Misc queries) 3 February 9th 05 05:51 PM


All times are GMT +1. The time now is 04:58 AM.

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"