发布于 2019-09-03 08:07:25
这应该是可行的:
ActiveSheet.Buttons.Add(185.25, 61.5, 85.5, 24.75).Select
数字是协调的,所以如果要将按钮添加到单元格中,就必须使用单元格的左边/顶部.像这样
With ActiveSheet
.Buttons.Add(.Cells(2, 2).Left, .Cells(2, 2).Top, 85.5, 24.75).Select
End With
若要包括范围的宽度和高度,如“A1:B2”.
With ActiveSheet
.Buttons.Add(.Cells(1, 1).Left, .Cells(2, 2).Top, .Cells(1, 1).Width + .Cells(1, 2).Width, .Cells(1, 1).Height + .Cells(2, 2).Height).Select
End With
发布于 2019-09-03 08:07:51
试试这个:
ActiveSheet.Shapes.AddFormControl xlButtonControl, 100, 100, 50, 20
数字是插入按钮的左边位置、顶部位置、宽度和高度。
https://stackoverflow.com/questions/57767453
复制相似问题