Excel VBA: How to programably turn on Snap-To-Grid

2019-07-24 05:32发布

How to turn on snap to grid in Excel using VBA ?

enter image description here

2条回答
淡お忘
2楼-- · 2019-07-24 05:50

Try Application.CommandBars.FindControl(ID:=549).Execute (tested up to excel 2010)

查看更多
在下西门庆
3楼-- · 2019-07-24 06:04

More precisely, first checking whether Snap-grid is already enabled or not

 Sub Snap_to_grid()
    With Application.CommandBars.FindControl(ID:=549)
        If Not (.Enabled) Then: .Execute
    End With
 End Sub
查看更多
登录 后发表回答