I created a figure:
Sub gen_button() l = ActiveSheet.Range("H10:H11").Left t = ActiveSheet.Range("H10:H11").Top w = ActiveSheet.Range("H10:H11").Width h = ActiveSheet.Range("H10:H11").Height ActiveSheet.Shapes.AddShape(msoShapeRectangle, l, t, w, h).Select Selection.ShapeRange.Line.Visible = msoFalse Selection.Text = "Генерировать" Selection.Font.Color = RGB(0, 0, 0) Selection.HorizontalAlignment = 1 Selection.ShapeRange.Fill.ForeColor.RGB = RGB(0, 255, 0) End Sub But I also want to assign a macro call to it, how to do it?