View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Auto-Insert & Delete Comments

Hi guys,

How could the sub below (which works for a single cell D8)
be extended to work correspondingly across a range of data,
say, to track E6:AE729 in Sheet1 and insert comment boxes
accordingly in Sheet2 ?

Also how could the inserted comment boxes be removed
if corresponding cells in Sheet1 were cleared / made blank later ?

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)

Set Alert = Sheets("Sheet1").Range("D8")
If Application.WorksheetFunction.IsNumber(Alert) = False _
Then Exit Sub
If Alert 0 Then
Sheets("Sheet2").Select
With Range("D8")
.ClearComments
.AddComment
.Comment.Visible = False
.Comment.Text Text:="Quantity: " & Alert
End With
End If

End Sub

--
Rgds
Max
xl 97
---
Please respond in thread
xdemechanik <atyahoo<dotcom
----