Creating such equations with VBA using the equation editor gets fairly complex. See:
https://software-solutions-online.co...ing-equations/
A simpler alternative might be to use an EQ field. For example:
Code:
Sub LongDivision()
Dim StrVal As String, Fld As Field
StrVal = Trim(InputBox("Amount to divide"))
Set Fld = ActiveDocument.Fields.Add(Range:=Selection.Range, Type:=wdFieldEmpty, _
Text:="EQ \s\up6(\f(,\)" & StrVal & "))", PreserveFormatting:=False)
Fld.Code.Text = Trim(Fld.Code.Text)
Set Fld = Nothing
End Sub