2017年最后一个工作日下午,同桌扔来一个Excel工作簿,类似如下,需要将右侧单元格中的内容批量写入左侧单元格的批注中。 写了几行VBA可以快速实现,效果如下 稍微美化了下批注形状为iPhone圆 VBA代码如下,如有需要的读者可以试试。 Sub 批注()
Dim cell As Range
For Each cell In Selection
cell.AddComment
cell.Comment.Text Text:=cell.Offset(0, 1).Value
With cell.Comment
.Visible = True
.Shape.Select True
Selection.ShapeRange.AutoShapeType = msoShapeRoundedRectangle
.Visible = False
End With
Next cell
End Sub 以下是示例文件,宏已内置,可直接使用 链接: https://pan.baidu.com/s/1i5itNqX 密码: ncvh |
|
来自: 风雨后3o4wd4dh > 《地理》