PC Review


Reply
Thread Tools Rate Thread

comment with date

 
 
RKS
Guest
Posts: n/a
 
      4th Apr 2008
I can see the code for comment with date and time. its use with MICRO. can it
possible when I insert comment it will display with current date. without
using micro. please tell me how is possible. code which i have thru net is
below;

Sub CommentDateTimeAdd()
'adds comment with date and time,
' positions cursor at end of comment text

Dim strDate As String
Dim cmt As Comment

strDate = "dd-mmm-yy hh:mm:ss"
Set cmt = ActiveCell.Comment

If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:=Format(Now, strDate) & Chr(10)
Else
cmt.Text Text:=cmt.Text & Chr(10) _
& Format(Now, strDate) & Chr(10)
End If

With cmt.Shape.TextFrame
.Characters.Font.Bold = False
End With

SendKeys "%ie~"

End Sub

thanks for advance
RKS

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      4th Apr 2008
Maybe...

Excel picks up the username from
Tools|Options|General Tab|under the User Name box.
(xl2003 menu system)

You could go into that dialog each day and change the username to today's date.

If you wanted, you could also use a macro that would change the name to the
current date each time you opened the workbook.

Option Explicit
Sub Auto_Open()
Application.UserName = Format(Date, "mmmm dd, yyyy")
End Sub

But that's using a macro, too.

RKS wrote:
>
> I can see the code for comment with date and time. its use with MICRO. can it
> possible when I insert comment it will display with current date. without
> using micro. please tell me how is possible. code which i have thru net is
> below;
>
> Sub CommentDateTimeAdd()
> 'adds comment with date and time,
> ' positions cursor at end of comment text
>
> Dim strDate As String
> Dim cmt As Comment
>
> strDate = "dd-mmm-yy hh:mm:ss"
> Set cmt = ActiveCell.Comment
>
> If cmt Is Nothing Then
> Set cmt = ActiveCell.AddComment
> cmt.Text Text:=Format(Now, strDate) & Chr(10)
> Else
> cmt.Text Text:=cmt.Text & Chr(10) _
> & Format(Now, strDate) & Chr(10)
> End If
>
> With cmt.Shape.TextFrame
> .Characters.Font.Bold = False
> End With
>
> SendKeys "%ie~"
>
> End Sub
>
> thanks for advance
> RKS


--

Dave Peterson
 
Reply With Quote
 
RKS
Guest
Posts: n/a
 
      5th Apr 2008
Thanks its work fine. if we need username+date and time. i dont know about
programming so please change who is required and tell me.

Once again thanks and u people really magician.
RKS

"Dave Peterson" wrote:

> Maybe...
>
> Excel picks up the username from
> Tools|Options|General Tab|under the User Name box.
> (xl2003 menu system)
>
> You could go into that dialog each day and change the username to today's date.
>
> If you wanted, you could also use a macro that would change the name to the
> current date each time you opened the workbook.
>
> Option Explicit
> Sub Auto_Open()
> Application.UserName = Format(Date, "mmmm dd, yyyy")
> End Sub
>
> But that's using a macro, too.
>
> RKS wrote:
> >
> > I can see the code for comment with date and time. its use with MICRO. can it
> > possible when I insert comment it will display with current date. without
> > using micro. please tell me how is possible. code which i have thru net is
> > below;
> >
> > Sub CommentDateTimeAdd()
> > 'adds comment with date and time,
> > ' positions cursor at end of comment text
> >
> > Dim strDate As String
> > Dim cmt As Comment
> >
> > strDate = "dd-mmm-yy hh:mm:ss"
> > Set cmt = ActiveCell.Comment
> >
> > If cmt Is Nothing Then
> > Set cmt = ActiveCell.AddComment
> > cmt.Text Text:=Format(Now, strDate) & Chr(10)
> > Else
> > cmt.Text Text:=cmt.Text & Chr(10) _
> > & Format(Now, strDate) & Chr(10)
> > End If
> >
> > With cmt.Shape.TextFrame
> > .Characters.Font.Bold = False
> > End With
> >
> > SendKeys "%ie~"
> >
> > End Sub
> >
> > thanks for advance
> > RKS

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      5th Apr 2008
Option Explicit
Sub Auto_Open()
Dim VbLfPos As Long
Dim myStr As String
myStr = Application.UserName
VbLfPos = InStr(1, myStr, vbLf, vbTextCompare)

'strip out old date
If VbLfPos > 0 Then
myStr = Left(myStr, VbLfPos - 1)
End If

myStr = myStr & vbLf & Format(Date, "mmmm dd, yyyy")

Application.UserName = myStr
End Sub


RKS wrote:
>
> Thanks its work fine. if we need username+date and time. i dont know about
> programming so please change who is required and tell me.
>
> Once again thanks and u people really magician.
> RKS
>
> "Dave Peterson" wrote:
>
> > Maybe...
> >
> > Excel picks up the username from
> > Tools|Options|General Tab|under the User Name box.
> > (xl2003 menu system)
> >
> > You could go into that dialog each day and change the username to today's date.
> >
> > If you wanted, you could also use a macro that would change the name to the
> > current date each time you opened the workbook.
> >
> > Option Explicit
> > Sub Auto_Open()
> > Application.UserName = Format(Date, "mmmm dd, yyyy")
> > End Sub
> >
> > But that's using a macro, too.
> >
> > RKS wrote:
> > >
> > > I can see the code for comment with date and time. its use with MICRO. can it
> > > possible when I insert comment it will display with current date. without
> > > using micro. please tell me how is possible. code which i have thru net is
> > > below;
> > >
> > > Sub CommentDateTimeAdd()
> > > 'adds comment with date and time,
> > > ' positions cursor at end of comment text
> > >
> > > Dim strDate As String
> > > Dim cmt As Comment
> > >
> > > strDate = "dd-mmm-yy hh:mm:ss"
> > > Set cmt = ActiveCell.Comment
> > >
> > > If cmt Is Nothing Then
> > > Set cmt = ActiveCell.AddComment
> > > cmt.Text Text:=Format(Now, strDate) & Chr(10)
> > > Else
> > > cmt.Text Text:=cmt.Text & Chr(10) _
> > > & Format(Now, strDate) & Chr(10)
> > > End If
> > >
> > > With cmt.Shape.TextFrame
> > > .Characters.Font.Bold = False
> > > End With
> > >
> > > SendKeys "%ie~"
> > >
> > > End Sub
> > >
> > > thanks for advance
> > > RKS

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you take your name/date out of the Discussion Comment box? =?Utf-8?B?U2hhdW5XaW4=?= Microsoft Powerpoint 3 18th Jul 2006 05:02 AM
Comment box with Date =?Utf-8?B?Sm9obg==?= Microsoft Access 1 18th Jun 2005 07:08 PM
comment box with date Josh Microsoft Excel Misc 1 21st Jul 2004 05:14 PM
Re: after updating or entering a comment, the date is entered into that comment John Vinson Microsoft Access 0 4th Jun 2004 01:49 AM
date in comment box =?Utf-8?B?Um96IE9nbGVzYnk=?= Microsoft Excel Worksheet Functions 1 19th Mar 2004 09:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 PM.