Excel实现仿放大镜功能。点击单元格,自动放大单元格的内容。
通过调整宏代码,可以设置单元格内容放大的倍数,放大的背景等。
作者:Excel小子-Office中国
Excel仿放大镜操作动画
Excel仿放大镜详细VBA代码:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim a As Shape
x = Target(1).Row
y = Target(1).Column
If boo = False Then
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, Target.Top, Target.Left + Target.Width + 20, 250, 130).Select
Selection.Name = "MyLabel"
End If
ActiveSheet.Shapes("MyLabel").Select
Selection.Formula = Target.Address
Selection.Font.Size = Target(1).Font.Size + 30
Selection.Top = Target.Top - 30
Selection.Left = Target.Left + Target.Width + 20
Selection.ShapeRange.Line.Visible = msoFalse
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
.Solid
End With
Target.Select
boo = True
End Sub
如喜欢此技巧,手机右上角点开,分享到QQ空间,方便自己以后看