How do I quickly add quotation marks?

T

tgriffin

I'd like to highlight a phrase and then use a keystroke to add quotation
marks at the beginning and end of the phrase (Often I put quotes around just
one or two words)
 
P

Peter T. Daniels

Seems like it takes more mouse-manipulation to highlight a phrase than
to simply type the quotation marks at the beginning and end?
 
G

Graham Mayor

Whether or not you agree with Peter, what you requested is easily achieved
with a macro attached to a toolbar button or keyboard shortcut. As you have
not indicated which quotes you wish to add, the following macro can easily
be adapted to use single or double, smart or straight quotes by removing the
apsotrophe from start of the relevant line to the start of the currently
active line. You'll see what I mean when you paste it to the vba editor.

Sub AddQuotes()
Dim oRng As Range
Set oRng = Selection.Range
'Double smart quotes
oRng.Text = Chr(147) & oRng.Text & Chr(148)
'Double straight quotes
'oRng.Text = Chr(34) & oRng.Text & Chr(34)
'Single smart quotes
'oRng.Text = Chr(145) & oRng.Text & Chr(146)
'Single straight quotes
'oRng.Text = Chr(39) & oRng.Text & Chr(39)
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top