Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-30-2018, 05:53 PM
Rayroshi Rayroshi is offline Is it possible to make a macro for inserting a 'division box?' Windows 7 64bit Is it possible to make a macro for inserting a 'division box?' Office 2003
Novice
Is it possible to make a macro for inserting a 'division box?'
 
Join Date: May 2011
Posts: 21
Rayroshi is on a distinguished road
Default Is it possible to make a macro for inserting a 'division box?'


I am using Word 2007 and am trying to make long division problems in which the dividend appears in the (hard to describe, here) traditional 'division box' that we all were presented with in elementary school, which looks like a closing parenthesis followed by an overbar. I don't want to use the forward slash, such as this: 24/2500, but rather 24)2500, where the '2500' has an overbar above it.

I have searched elsewhere, and have found that I can use the following sequence for any given problem: Type the divisor>Type a closing parenthesis>Type the dividend>Insert>Equation>Accent>Overbar>Enter. This renders a pretty good/usable division problem; however, as can be seen, it's kind of a long, drawn-out hassle, when trying to make several problems. Thus my questions: Is there a better way to make such a division-problem format? If not, might I be able to, somehow, make a macro consisting of the above-mentioned sequence of keystrokes that would do the trick, allowing me to quickly insert it, then fill in the numbers? I'm not that Word-savvy, so any help would be greatly appreciated.
Reply With Quote
  #2  
Old 08-30-2018, 06:40 PM
macropod's Avatar
macropod macropod is offline Is it possible to make a macro for inserting a 'division box?' Windows 7 64bit Is it possible to make a macro for inserting a 'division box?' Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to make a macro for inserting a 'division box?' Footnote extraction macro [Why is this macro so slow? / anyway to make it faster?] Le_Blanc Word VBA 10 03-22-2021 11:38 AM
Equations - Bracketed division size Dan110024 Word 0 09-03-2015 11:10 PM
Division by Zero error Nate PowerPoint 1 11-29-2012 10:51 PM
Is it possible to make a macro for inserting a 'division box?' No paragraphs division hbrt Word 1 01-24-2012 05:01 PM
Is it possible to make a macro for inserting a 'division box?' division zero escape? gmyls Excel 2 05-22-2009 02:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft