|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
请参考
Dim JGD As Shape
If Me.ToggleButton2.Caption = "jgd-yg" Then
ToggleButton2.Caption = "jgd-yk"
Else
ToggleButton2.Caption = "jgd-yg"
For Each JGD In ActiveSheet.Shapes
If JGD.Name = "jgd-yk" Then JGD.Delete
Next
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim JGD As Shape, lc!, hh!, Col
If Sheet1.ToggleButton2.Caption = "jgd-yk" Then
n = Target.Row: Col = Target.Column: lc = Target.Width: hg = Target.Height
nn = Application.Max(n - 100, 1)
hs = Application.Max(Col - 100, 1)
On Error Resume Next
ActiveSheet.Shapes("jgd-yk").Delete
ActiveSheet.Shapes("jgd-yk").Delete
With ActiveSheet.Shapes.AddShape(msoShapeRectangle, Cells(nn, Col).Left, Cells(nn, Col).Top, 10, hg * 200)
.Line.Visible = msoFalse
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(247, 17, 238)
.Fill.Transparency = 0.6
.Name = "jgd-yk"
End With
With ActiveSheet.Shapes.AddShape(msoShapeRectangle, Cells(n, hs).Left, Cells(n, 1).Top, lc * 200, 10) 'hh)
.Line.Visible = msoFalse
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(247, 17, 238)
.Fill.Transparency = 0.6
.Name = "jgd-yk"
End With
End If
End Sub
|
评分
-
1
查看全部评分
-
|