cell overflow problems
I played with some code and if you need to modify the sentences, this works pretty well.
Put this macro on the ThisWorkbook sheet. To activate you just double click on the cell that needs the comment added
you could add IF statements if you need to limit the cells that can be changed either by individual cells or specific columns or rows ( IF LEFT(TEMP,2) = $A THEN .... would limit the macro to column A only)
dim TEMP, COM as string
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
TEMP = Target.Address
' OPTIONAL IF STATEMENT HERE
COM = Range(TEMP)
Range(TEMP).Select
On Error GoTo 10
Range(TEMP).AddComment
Range(TEMP).Comment.Visible = False
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range(TEMP).Comment.Shape.ScaleHeight 0.3, msoFalse, msoScaleFromTopLeft
Range(TEMP).Comment.Shape.ScaleWidth 2.78, msoFalse, msoScaleFromTopLeft
10 Range(TEMP).Comment.Text Text:= COM
ActiveCell.Next.Select
End Sub
|