Changing an ellipse to circle using keyboard shortcut

Hello, beginner here. I'm looking for a modifier key combination that, when pressed, will force an ellipse back to be a circle. I know that I can go and set the width and height of the ellipse to be equal, but I want to streamline my work and do it with a keystroke if possible.

  • Hello, everybody!
    Hello, taydin!

    In any command module of Globalmacros.gms place:

    Sub F3()
    'MsgBox "F3 PRESSED"
    ActiveShape.SizeHeight = ActiveShape.SizeWidth
    End Sub

    Sub CTRL_F3()
    ActiveShape.SizeWidth = ActiveShape.SizeHeight
    End Sub

    Then In Customize menu assign F3 to run Sub F3 and Ctrl-F3 to run Sub CTRL_F3

    Ready!

    Improved variant: In this variant each pressing of F3 change ellipse to smal circle, big circle and ellipse again

    With the macro, rectangles can be changed into small and large squares

    Public Sub F3()
    flag = flag + 1

    If ActiveShape.SizeWidth <> ActiveShape.SizeHeight Then
    ActiveShape.ObjectData.Item("DsizeWidth") = Mid("a" & ActiveShape.SizeWidth * 25.4, 2)
    ActiveShape.ObjectData.Item("DsizeHeight") = Mid("a" & ActiveShape.SizeHeight * 25.4, 2)
    End If

    If flag = 1 Then
    ActiveShape.SizeHeight = ActiveShape.SizeWidth
    End If
    If flag = 2 Then
    ActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4
    ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4
    End If
    If flag = 3 Then
    ActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeWidth") / 25.4
    ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4
    flag = 0
    End If
    End Sub

  • Hello, taydin, everybody again

    One other improved solution. Each pressing of F3 change ellipse to small circle, one other pressing - to big circle. The third pressing - change circle to ellipse. The sizeWidth and sizeHeight of ellipse are stored hard in object data fields and can be used to restore ellipse.

    With the macro, rectangles can be changed into small and large squar

    Enjoi!

    Public Sub F3()
    'MsgBox "F3 PRESSED"
    'ActiveShape.SizeHeight = ActiveShape.SizeWidth
    flag = flag + 1
    'On Error Resume Next
    'If ActiveShape.Type = 2 Then 'ELLIPSE
    'ActiveShape.SizeHeight = ActiveShape.SizeWidth
    'End If
    If ActiveShape.SizeWidth <> ActiveShape.SizeHeight Then
    ActiveShape.ObjectData.Item("DsizeWidth") = Mid("a" & ActiveShape.SizeWidth * 25.4, 2)
    ActiveShape.ObjectData.Item("DsizeHeight") = Mid("a" & ActiveShape.SizeHeight * 25.4, 2)
    End If

    If flag = 1 Then
    ActiveShape.SizeHeight = ActiveShape.SizeWidth
    End If
    If flag = 2 Then
    ActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4
    ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4
    End If
    If flag = 3 Then
    ActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeWidth") / 25.4
    ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4
    flag = 0
    End If
    'If flag = 4 Then
    'ActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4
    'ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeWidth") / 25.4
    'flag = 0
    'End If