|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
学习下
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If (Intersect(Target, Range("G3:AQ6")) Is Nothing) And _
(Intersect(Target, Range("D10:K80")) Is Nothing) And _
(Intersect(Target, Range("M10:BA46")) Is Nothing) Then Exit Sub
Dim TT As String
Target.ClearNotes
If Target.MergeCells Then
Set R = Target(1)
ElseIf Target.Cells.Count <> 1 Then Exit Sub
Else
Set R = Target
End If
CX R.Value
If DAT <> "" Then
nn = Len(Replace(DAT, Chr(10), ""))
mm = Len(DAT) - nn '+ 1 '数据带回车的行数
If mm < 1 Then mm = Len(DAT) / 50 '数据无回车的行数
With R
.AddComment
Set C = .Comment
C.Text Text:=DAT
With C.Shape
.Width = 240
.Height = 13 * mm
End With
End With
End If
End Sub
|
|