Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA to edit a comment
Good morning,
I am using Windows XP; Office 2002 SP2. i am trying to put together some code that will: A. Create a comment in the current cell (without naming the cell by range) B. Enter the folling text double spaced and bolded Analysis: Result: Reviewers: C. And size the comment box to a specific size. I recorded a macro as I performed these operations and got the following code. (I replaced the cell range references w/ "Activecell" to make the cell selection more dynamic.) This is the code from Excel: Sub Notes() ' ' Notes Macro ' Macro recorded 11/5/2007 by DD065C ' ' ActiveCell.Select ActiveCell.AddComment ActiveCell.Comment.Visible = False ActiveCell.Comment.Text Text:= _ "DD065C:" & Chr(10) & "" & Chr(10) & "Analysis: " & Chr(10) & "" & Chr(10) & "Result: " & Chr(10) & "" & Chr(10) & "Reviewers: " 'Selection.ShapeRange.ScaleWidth 1.8, msoFalse, msoScaleFromTopLeft 'Selection.ShapeRange.ScaleHeight 3.41, msoFalse, msoScaleFromTopLeft 'ActiveCell.Comment.Shape.Select True ActiveCell.Comment.Text Text:= _ "DD065C:" & Chr(10) & "" & Chr(10) & "Analysis: " & Chr(10) & "" & Chr(10) & "Result: " & Chr(10) & "" & Chr(10) & "Reviewers: " End Sub When I run the macro on a new cell, everything works except the lines I have commented out: 'Selection.ShapeRange.ScaleWidth 1.8, msoFalse, msoScaleFromTopLeft 'Selection.ShapeRange.ScaleHeight 3.41, msoFalse, msoScaleFromTopLeft 'ActiveCell.Comment.Shape.Select True These always trigger a debug error stating: Runtime Error '438'. Object does not support this object or method. Does anybody know why this is occuring and can recommend a correction? Thanks, Brent |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Edit comment in cell | Excel Discussion (Misc queries) | |||
Comment box appears many rows away when trying to edit | Excel Discussion (Misc queries) | |||
Comment box appears many rows away when trying to edit | Excel Discussion (Misc queries) | |||
How can I edit a comment w/o first having to select Show Comment | Excel Discussion (Misc queries) | |||
cannot edit comment | Excel Discussion (Misc queries) |