If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Store current date & later on user in cell

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-10, 01:06
sanjaylml sanjaylml is offline
Registered User
 
Join Date: May 2008
Posts: 48
Store current date & later on user in cell

How can I store current date & use it in cell ?

Actually, I wish whenever any user run macro, it store the current date & later on use the stored date in cell. I know this is possible through VBA. I have tried to do that but it gives an error.

Please help.
Reply With Quote
  #2 (permalink)  
Old 03-24-10, 05:09
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Hi,
Quote:
I know this is possible through VBA. I have tried to do that but it gives an error.
It is possible through VBA.

If you post the part of the code where you tried to do it together with the error description, then we should be able to tell you why it's going wrong.

Hope that helps...
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #3 (permalink)  
Old 03-24-10, 13:41
AnanthaP AnanthaP is offline
Registered User
 
Join Date: May 2009
Location: India
Posts: 62
Actually, in one cell, you should use vba/macro to "paste special" the value of the first cell (where the date was first got as the current date).

Code:
'
    Range("A1").Select
    Selection.Copy
    Range("A3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("A1").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("A3").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
In the example, cell A1 contains the "now" value with format "dd/mm/yyyy hh:mm:ss" and cell A3 the stored value for later use.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On