|
本帖最后由 dryrtsuy 于 2015-11-9 20:09 编辑
Private Sub CommandButton1_Click()
With Selection
If Evaluate(.Text) * 2 = Evaluate(.Text & "*2") Then
.Replace .Text, .Text & "*2"
Else
.Replace .Text, "(" & .Text & ")*2"
End If
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
CommandButton1.Visible = False
With Target
If .Count > 1 Or .Column <> 1 Then Exit Sub
If IsError(Evaluate(.Text)) Then Exit Sub
End With
With CommandButton1
.Top = Target.Top
.Left = Target.Offset(, 1).Left - 18
.Height = Target.Height
.Visible = True
End With
End Sub
???目标代码单元格
|
|