PC Review


Reply
Thread Tools Rate Thread

Selecting a word before a character to make bold...

 
 
rohit92
Guest
Posts: n/a
 
      25th Oct 2009
Hey guys,
I think this might help me in the future, but I want to use something like
this for school. Say i have this text:
"dog- an animal that barks
cat- an animal that meows"

So what I want to do is select the words before the "-" to make them bold.
The words dog and cat should be bold. Sometimes i have very large lists to do
this with and it gets annoying to constantly select each word and make it
bold.. So let me know if it is possible.
 
Reply With Quote
 
 
 
 
Doug Robbins - Word MVP
Guest
Posts: n/a
 
      25th Oct 2009

Select all of the paragraphs and then run a macro containing the following
code:

Dim i As Long
Dim rng As Range
With Selection
For i = 1 To .Paragraphs.Count
Set rng = .Paragraphs(i).Range
rng.End = rng.Start + InStr(rng, "-") - 1
rng.Font.Bold = True
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"rohit92" <(E-Mail Removed)> wrote in message
news:99BA3FC8-F7F2-4625-8353-(E-Mail Removed)...
> Hey guys,
> I think this might help me in the future, but I want to use something like
> this for school. Say i have this text:
> "dog- an animal that barks
> cat- an animal that meows"
>
> So what I want to do is select the words before the "-" to make them bold.
> The words dog and cat should be bold. Sometimes i have very large lists to
> do
> this with and it gets annoying to constantly select each word and make it
> bold.. So let me know if it is possible.


 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      26th Oct 2009

I see we have two threads on the same subject

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Doug Robbins - Word MVP wrote:
> Select all of the paragraphs and then run a macro containing the
> following code:
>
> Dim i As Long
> Dim rng As Range
> With Selection
> For i = 1 To .Paragraphs.Count
> Set rng = .Paragraphs(i).Range
> rng.End = rng.Start + InStr(rng, "-") - 1
> rng.Font.Bold = True
> Next i
> End With
>
>
>
> Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
> "rohit92" <(E-Mail Removed)> wrote in message
> news:99BA3FC8-F7F2-4625-8353-(E-Mail Removed)...
>> Hey guys,
>> I think this might help me in the future, but I want to use
>> something like this for school. Say i have this text:
>> "dog- an animal that barks
>> cat- an animal that meows"
>>
>> So what I want to do is select the words before the "-" to make them
>> bold. The words dog and cat should be bold. Sometimes i have very
>> large lists to do
>> this with and it gets annoying to constantly select each word and
>> make it bold.. So let me know if it is possible.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting before a character to make bold... rohit92 Microsoft Word New Users 2 26th Oct 2009 07:14 AM
Make 1st word in cell bold after combining words from two cells RJQMAN@gmail.com Microsoft Excel Programming 10 5th Jun 2008 07:31 PM
Is it possible to make a word in a formula bold? SpielbergRules Microsoft Excel Worksheet Functions 5 2nd Jul 2006 07:59 PM
Windows 2000 print Chinese character with bold same as not bold S. T. Wong Microsoft Windows 2000 0 3rd Mar 2004 03:52 AM
selecting sentence in word turns all to bold =?Utf-8?B?R2FyeQ==?= Microsoft Word Document Management 3 3rd Feb 2004 08:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:55 AM.