关于excel表格的操作问题。请教办公软件高手。
来源:百度知道 编辑:UC知道 时间:2024/07/06 00:06:21
在你的表标签那里
右键单击——代码
在打开的VB窗口中,
复制这段代码粘贴上去,
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Target.Column = 1 Then
Target.ClearComments
Target.AddComment
With Target.Comment
.Visible = True
.Text Sheets("Sheet2").Cells(1, 2).Value & Sheets("Sheet2").Cells(Target.Row, Target.Column + 1).Value & vbCrLf & _
Sheets("Sheet2").Cells(1, 3).Value & Sheets("Sheet2").Cells(Target.Row, Target.Column + 2).Value & vbCrLf & _
Sheets("Sheet2").Cells(1, 4).Value & Sheets("Sheet2").Cells(Target.Row, Target.Column + 3).Value & vbCrLf & _
Sheets("Sheet2").Cells(1, 5).Value & Sheets("Sheet2").Cells(Target.Row, Target.Column + 4).Value
End With
End If
End Sub