发布网友 发布时间:2022-04-29 15:28
共2个回答
热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
可以参考以下宏代码热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
可以参考以下宏代码热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
可以参考以下宏代码热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
可以参考以下宏代码热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
可以参考以下宏代码热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
可以参考以下宏代码热心网友 时间:2023-10-15 12:27
可以参考以下宏代码热心网友 时间:2023-10-15 12:27
'给所有满足条件的单元格添加批注追答是指所有的批注只添加的B1和D1中?后面不需要
Sub 添加批注()
Dim I, X As Long
Cells.ClearComments
X = ActiveCell.SpecialCells(xlLastCell).Row
Cells(2, 2).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 1) & " " & Cells(I, 2) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
Cells(2, 4).Select
Selection.AddComment
For I = 2 To X
Selection.Comment.Text Selection.Comment.Text & Cells(I, 3) & " " & Cells(I, 4) & vbCrLf
Next I
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select True
Selection.ShapeRange.ScaleHeight X / 5 - 0.2, msoFalse, msoScaleFromTopLeft
ActiveCell.Comment.Visible = False
End Sub
热心网友 时间:2023-10-15 12:27
可以参考以下宏代码