小编Yon*_*ong的帖子

使单元格看起来像按钮

我试图让 Excel 单元格看起来像按钮而不实际插入按钮。

For Each myCell In Range(BoardSize)
    With myCell
        .Borders.LineStyle = xlContinuous
        .Borders.Weight = xlThick
        .Borders.Color = RGB(110, 110, 110)
        .Interior.Color = RGB(180, 180, 180)
    End With

        myCell.Borders(xlEdgeTop).Color = RGB(255, 255, 255)
        myCell.Borders(xlEdgeLeft).Color = RGB(255, 255, 255)
Next myCell
Run Code Online (Sandbox Code Playgroud)

它适用于一个单元格:

在此处输入图片说明

但在很大范围内,它看起来像这样:

在此处输入图片说明

我想要的是不使用实际命令按钮的东西,例如:

在此处输入图片说明

excel vba

5
推荐指数
1
解决办法
1475
查看次数

VBA点击一个单元格和动作,非常简单但不适合我

H!我是VBA的新手.这可能是一个太简单的问题,但我正在努力使用VBA:当单击一个单元格(1,1),因为它有1,msgbox会显示"hi"

Sub test()

'click action 'when cell(1,1) is clicked and if cells(1,1) is 1, msgbox saying "hi" will show up, if not nothing If Cells(1, 1) = 1 Then
    MsgBox "hi"
    Else 
End If
End Sub
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

2
推荐指数
1
解决办法
2192
查看次数

标签 统计

excel ×2

vba ×2

excel-vba ×1