![]() |
|
![]() | ||
|
Subject:
MS Excel: Auto Insert Text into Comment Text box
Category: Computers > Programming Asked by: infohelp-ga List Price: $10.00 |
Posted:
18 Jan 2003 23:32 PST
Expires: 19 Jan 2003 23:08 PST Question ID: 145449 |
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: MS Excel: Auto Insert Text into Comment Text box
From: rac-ga on 19 Jan 2003 05:51 PST |
Hi, To do this I written a VBA macro. Please try and give feedback. Attached in the following link sample xls file with macro. http://rac-ga.tripod.com/addcomment.xls Download the addcomment.xls file. open the addcomment.xls file. From the tools menu-->Macros-->Visual basic editor Copy the sub addcomment()....End Sub and paste it to your excel sheet(your calendar excelsheet) visual basic editor. Save it. To create a toolbar button follow the steps as follows. 1.From your worksheet Right click on the toolbar. 2.Select customise 3.Select New 4.Select Ok. This will create a custom toolbar 5.Select the commands tab. 6.From the categories select Macros 7.Drag the custombutton(A yellow face) to the newly created toolbar and drop it. Now the Icon is in the toolbar. 8.Right click the icon(Yellowface) in the toolbar 9.In the Name give &Add Comment (This will come as tool tip) 10.Select Assign Macro 11.In the macro list select AddComment macro and say Ok. Save the workbook. Now Select a cell and clik the toolbar button. You will get the comment cell filled up. |
Subject:
Re: MS Excel: Auto Insert Text into Comment Text box
From: rac-ga on 19 Jan 2003 05:58 PST |
Hi, pasted the macro below it use it, Just incase if you find difficulty in downloading the xls file. Sub AddComment() 'This will add the comment text in the active cell With ActiveCell .AddComment .Comment.Text Text:=Application.UserName & Chr(10) & Chr(10) & _ "Physical:" & Chr(10) & Chr(10) & _ "Emotional:" & Chr(10) & Chr(10) & _ "Financial:" & Chr(10) & Chr(10) & _ "Relationships:" & Chr(10) & Chr(10) & _ "Spiritual:" & Chr(10) & Chr(10) & _ "Career:" & Chr(10) & Chr(10) End With ActiveCell.Comment.Shape.ScaleHeight 2.5, msoFalse, msoScaleFromTopLeft ActiveCell.Comment.Shape.ScaleWidth 2.5, msoFalse, msoScaleFromTopLeft ActiveCell.Comment.Visible = True End Sub Thanks, RAC |
Subject:
Re: MS Excel: Auto Insert Text into Comment Text box
From: infohelp-ga on 19 Jan 2003 14:52 PST |
Rac, Thanks for the fast reply. I thought I followed your instructions carefully, but when I select a cell and click on the icon button, I get an error message box stating it can't find the macro (even though I thought I assign it as you described) The error text states: The macro "2003Cal - Life Plan Log.xls!AddComment.AddComment' cannot be found. Like your xls I added the code as a module (named it AddComment) in my Cal xls. Was this not correct? Thx. |
Subject:
Re: MS Excel: Auto Insert Text into Comment Text box
From: infohelp-ga on 19 Jan 2003 15:32 PST |
Rac, Got it to work (my security settings where set to High" Two questions: 1) In the code, why two ActiveCell.Comment. ... after the Exit With line. 2) Is there a way to sign the macro in a way to allow it to run with a security setting of High vs. Medium. Thanks again. |
Subject:
Re: MS Excel: Auto Insert Text into Comment Text box
From: rac-ga on 19 Jan 2003 18:21 PST |
Hi, Nice to note that you are able to run the macro. 1. The 2 lines below endwith makes the size(height and width) of the comment box. As of now they are set as 2.5. you can modify it based on your need. ActiveCell.Comment.Shape.ScaleHeight 2.5, msoFalse,msoScaleFromTopLeft ActiveCell.Comment.Shape.ScaleWidth 2.5, msoFalse, msoScaleFromTopLeft ActiveCell.Comment.Visible = True The last line makes the comment box visible. 2. I am not aware of how to make the comment text bold. May be some other researchers may be able to help. 3. Security settings: I am using excel-97. It seems you are latter version of excel. I am not aware of how to make security settings. Please refer vba help menu. Thanks, RAC |
Subject:
Re: MS Excel: Auto Insert Text into Comment Text box
From: infohelp-ga on 19 Jan 2003 19:06 PST |
Thanks RAC, Perhaps, as you suggest, another researcher will know how to bold. Regardless, I believe your efforts are well worth the price, so feel free to post as answer and close. Thx. again! InfoHelp |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |