Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Selection Contains Space(s)?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frankbelly - 27 Sep 2006 21:57 GMT
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.
Jezebel - 27 Sep 2006 22:14 GMT
If instr(Selection, " ") > 0 then

> I'm trying to check to see if the current Selection contains one or more
> spaces.
[quoted text clipped - 4 lines]
>
> Any help is greatly appreciated.  Thanks in advance.
Frankbelly - 27 Sep 2006 22:41 GMT
Perfect!  

Once again, thank you so much Jezebel

> If instr(Selection, " ") > 0 then
>
[quoted text clipped - 6 lines]
> >
> > Any help is greatly appreciated.  Thanks in advance.
Frankbelly - 27 Sep 2006 23:00 GMT
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

> Perfect!  
>
[quoted text clipped - 10 lines]
> > >
> > > Any help is greatly appreciated.  Thanks in advance.
Tony Jollans - 28 Sep 2006 06:19 GMT
There are several ways. here's one:

   if len(trim(selection)) = 0

--
Enjoy,
Tony

> Actually, I forgot one more thing.  This is my fault.  I'm only giving you a
> part of what I'm trying to do.
[quoted text clipped - 21 lines]
> > > >
> > > > Any help is greatly appreciated.  Thanks in advance.
Frankbelly - 28 Sep 2006 21:41 GMT
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.

> There are several ways. here's one:
>
[quoted text clipped - 37 lines]
> > > > >
> > > > > Any help is greatly appreciated.  Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.