Home » Category » Microsoft Excel

Microsoft Excel: Adding text to an Activecell

205| Fri, 23 May 2008 00:39:00 GMT| anonymous| Comments (2)
Hi there...Need help!!

I am writing some code whereby once I know which cell is the current
ActiveCell, I have to add a timestamp value to the cell which I am getting as
follows.

Application.ActiveCell.Value = Format(Date)

Now my trouble is that this statement is overwriting the existing
information in the cell. I want my code to add timestamp either at the top or
bottom of existing text in the cell without it deleting any current
contents...

So if A6 = "Hello World" before....

I want it to look like this after code...

A6= 25/10/2007 "Hello World" or "Hello World " 25/10/2007

Hope you can help...Let me know if you need more information...

Regards
Veeraan

Keywords & Tags: adding, text, activecell, microsoft, excel

URL: http://www.developertags.com/microsoft-excel/15003/
 
«« Prev - Next »» 2 helpful answers below.
what about

ActiveCell.Value = activecell.value & " " & Format(Date)

(application is not needed!)

hth Carlo

"veeraan" wrote:

> Hi there...Need help!!
> I am writing some code whereby once I know which cell is the current
> ActiveCell, I have to add a timestamp value to the cell which I am getting as
> follows.
> Application.ActiveCell.Value = Format(Date)
> Now my trouble is that this statement is overwriting the existing
> information in the cell. I want my code to add timestamp either at the top or
> bottom of existing text in the cell without it deleting any current
> contents...
> So if A6 = "Hello World" before....
> I want it to look like this after code...
> A6= 25/10/2007 "Hello World" or "Hello World " 25/10/2007
> Hope you can help...Let me know if you need more information...
> Regards
> Veeraan
>

carlo | Fri, 23 May 2008 00:40:00 GMT |

Thanks Carlo...that helps

"Carlo" wrote:

> what about
> ActiveCell.Value = activecell.value & " " & Format(Date)
> (application is not needed!)
> hth Carlo
> "veeraan" wrote:
> > Hi there...Need help!!
> >
> > I am writing some code whereby once I know which cell is the current
> > ActiveCell, I have to add a timestamp value to the cell which I am getting as
> > follows.
> >
> > Application.ActiveCell.Value = Format(Date)
> >
> > Now my trouble is that this statement is overwriting the existing
> > information in the cell. I want my code to add timestamp either at the top or
> > bottom of existing text in the cell without it deleting any current
> > contents...
> >
> > So if A6 = "Hello World" before....
> >
> > I want it to look like this after code...
> >
> > A6= 25/10/2007 "Hello World" or "Hello World " 25/10/2007
> >
> > Hope you can help...Let me know if you need more information...
> >
> > Regards
> > Veeraan
> >
> >

veeraan | Fri, 23 May 2008 00:41:00 GMT |

Microsoft Excel Hot Answers

Microsoft Excel New questions

Microsoft Excel Related Categories