Group:  Microsoft Word ยป microsoft.public.word.vba.beginners
Thread: Selection Contains Space(s)?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Selection Contains Space(s)?
Frankbelly 27.09.2006 20:57:02
I'm trying to check to see if the current Selection contains one or more
spaces.

If I use Section = " " it only determines whether there is one space and
won't determine if there are multiple spaces in the selection. I need to
check if selection contains one or more spaces.

Any help is greatly appreciated. Thanks in advance.
Re: Selection Contains Space(s)?
"Jezebel" <warcrimes[ at ]whitehouse.gov> 27.09.2006 21:14:27
If instr(Selection, " ") > 0 then



"Frankbelly" <Frankbelly[ at ]discussions.microsoft.com> wrote in message
news:BA9032EC-04FA-4434-9F03-55A4A2B13C01[ at ]microsoft.com...
[Quoted Text]
> I'm trying to check to see if the current Selection contains one or more
> spaces.
>
> If I use Section = " " it only determines whether there is one space and
> won't determine if there are multiple spaces in the selection. I need to
> check if selection contains one or more spaces.
>
> Any help is greatly appreciated. Thanks in advance.


Re: Selection Contains Space(s)?
Frankbelly 27.09.2006 21:41:02
Perfect!

Once again, thank you so much Jezebel

"Jezebel" wrote:

[Quoted Text]
> If instr(Selection, " ") > 0 then
>
>
>
> "Frankbelly" <Frankbelly[ at ]discussions.microsoft.com> wrote in message
> news:BA9032EC-04FA-4434-9F03-55A4A2B13C01[ at ]microsoft.com...
> > I'm trying to check to see if the current Selection contains one or more
> > spaces.
> >
> > If I use Section = " " it only determines whether there is one space and
> > won't determine if there are multiple spaces in the selection. I need to
> > check if selection contains one or more spaces.
> >
> > Any help is greatly appreciated. Thanks in advance.
>
>
>
Re: Selection Contains Space(s)?
Frankbelly 27.09.2006 22:00:01
Actually, I forgot one more thing. This is my fault. I'm only giving you a
part of what I'm trying to do.

Basically what I'm trying to do is remove only spaces in front of some text.
I have selected the area in question properly, but I need to make sure the
selection contains only spaces and not any other characters so I can safely
remove it. Ultimately deleting this space that exists (if any) in front of
the text.

Thanks again for any help

"Frankbelly" wrote:

[Quoted Text]
> Perfect!
>
> Once again, thank you so much Jezebel
>
> "Jezebel" wrote:
>
> > If instr(Selection, " ") > 0 then
> >
> >
> >
> > "Frankbelly" <Frankbelly[ at ]discussions.microsoft.com> wrote in message
> > news:BA9032EC-04FA-4434-9F03-55A4A2B13C01[ at ]microsoft.com...
> > > I'm trying to check to see if the current Selection contains one or more
> > > spaces.
> > >
> > > If I use Section = " " it only determines whether there is one space and
> > > won't determine if there are multiple spaces in the selection. I need to
> > > check if selection contains one or more spaces.
> > >
> > > Any help is greatly appreciated. Thanks in advance.
> >
> >
> >
Re: Selection Contains Space(s)?
"Tony Jollans" <my forename at my surname dot com> 28.09.2006 05:19:11
There are several ways. here's one:

if len(trim(selection)) = 0

--
Enjoy,
Tony

"Frankbelly" <Frankbelly[ at ]discussions.microsoft.com> wrote in message
news:C37E53D3-85EC-495A-AA7F-DFB3847DCC0D[ at ]microsoft.com...
[Quoted Text]
> Actually, I forgot one more thing. This is my fault. I'm only giving you
a
> part of what I'm trying to do.
>
> Basically what I'm trying to do is remove only spaces in front of some
text.
> I have selected the area in question properly, but I need to make sure
the
> selection contains only spaces and not any other characters so I can
safely
> remove it. Ultimately deleting this space that exists (if any) in front
of
> the text.
>
> Thanks again for any help
>
> "Frankbelly" wrote:
>
> > Perfect!
> >
> > Once again, thank you so much Jezebel
> >
> > "Jezebel" wrote:
> >
> > > If instr(Selection, " ") > 0 then
> > >
> > >
> > >
> > > "Frankbelly" <Frankbelly[ at ]discussions.microsoft.com> wrote in message
> > > news:BA9032EC-04FA-4434-9F03-55A4A2B13C01[ at ]microsoft.com...
> > > > I'm trying to check to see if the current Selection contains one or
more
> > > > spaces.
> > > >
> > > > If I use Section = " " it only determines whether there is one space
and
> > > > won't determine if there are multiple spaces in the selection. I
need to
> > > > check if selection contains one or more spaces.
> > > >
> > > > Any help is greatly appreciated. Thanks in advance.
> > >
> > >
> > >


Re: Selection Contains Space(s)?
Frankbelly 28.09.2006 20:41:02
That worked perfectly. Thank you so much!

I'm an extreme Novice at VBA and this forum is great!

I try to figure things out on my own first, but when I hit a wall, it's nice
to know I have some place to go and get quality help.

Thanks again.


"Tony Jollans" wrote:

[Quoted Text]
> There are several ways. here's one:
>
> if len(trim(selection)) = 0
>
> --
> Enjoy,
> Tony
>
> "Frankbelly" <Frankbelly[ at ]discussions.microsoft.com> wrote in message
> news:C37E53D3-85EC-495A-AA7F-DFB3847DCC0D[ at ]microsoft.com...
> > Actually, I forgot one more thing. This is my fault. I'm only giving you
> a
> > part of what I'm trying to do.
> >
> > Basically what I'm trying to do is remove only spaces in front of some
> text.
> > I have selected the area in question properly, but I need to make sure
> the
> > selection contains only spaces and not any other characters so I can
> safely
> > remove it. Ultimately deleting this space that exists (if any) in front
> of
> > the text.
> >
> > Thanks again for any help
> >
> > "Frankbelly" wrote:
> >
> > > Perfect!
> > >
> > > Once again, thank you so much Jezebel
> > >
> > > "Jezebel" wrote:
> > >
> > > > If instr(Selection, " ") > 0 then
> > > >
> > > >
> > > >
> > > > "Frankbelly" <Frankbelly[ at ]discussions.microsoft.com> wrote in message
> > > > news:BA9032EC-04FA-4434-9F03-55A4A2B13C01[ at ]microsoft.com...
> > > > > I'm trying to check to see if the current Selection contains one or
> more
> > > > > spaces.
> > > > >
> > > > > If I use Section = " " it only determines whether there is one space
> and
> > > > > won't determine if there are multiple spaces in the selection. I
> need to
> > > > > check if selection contains one or more spaces.
> > > > >
> > > > > Any help is greatly appreciated. Thanks in advance.
> > > >
> > > >
> > > >
>
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net