Hi,

Is there a way to wrap pre-selected text with brackets using VBA? To
explain, the user types text (can be numbers, dates, one or more words),
selects the text to be wrapped with brackets and kicks off a macro to insert
open bracket at the beginning ([) and a closing bracket (]) at the end of
the selection.

Thanks in advance.

Re: Macro to Wrap Selected Text with Brackets by Stefan

Stefan
Mon Jul 05 07:11:16 CDT 2004

Try the following macro:

Sub AddBrackets()
Selection.InsertBefore "["
Selection.InsertAfter "]"
End Sub

--
Stefan Blom


"RYA" <ryanastas@h o t m a i l.com> wrote in message
news:e6c3uUoYEHA.992@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> Is there a way to wrap pre-selected text with brackets using VBA? To
> explain, the user types text (can be numbers, dates, one or more
words),
> selects the text to be wrapped with brackets and kicks off a macro
to insert
> open bracket at the beginning ([) and a closing bracket (]) at the
end of
> the selection.
>
> Thanks in advance.
>
>
>