LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Can I change the format of numerical & specific word referenceswithin a cell?

I am using the program to construct a document. When the document is
completed, each cell contains a paragraph. The program works well.
However, I would like to be able to go inside each cell and change the
format whenever there is a dollar value shown from standard format to
bold face and underline. I would, ideally, also like to change the
format when I state a month (January - December) and when a year
appears (2009, 2010, etc).

For example, the sentence in the cell, after constructing and pasting
in the cell, could read;

"The rent for the month of April 2009 is $550.00 payable on the last
day of May 2009."

I would like to make "April 2009" bold face and underline, as well as
$550.00 bold face and underline, and "May 2009" bold face and
underline.

When I started this project, I was doing this by having the program
count the characters in the sentences and adding them together, to
calculate the place to start the format change, sort of like this...

With ActiveCell.Characters(Start:=StartPoint1,
Length:=LengthUnderline1).Font
.Bold = True
.Underline = True
End With

This worked fine, and I used the concept countless times, calculating
the starting and ending points of the format change based on the
sentences constructed and inserted into the paragraph.

However, the options in constructing the paragraph have grown beyond
my wildest imagination, and there are now so many ways that the user
can construct multiple sentences within the cell, that the counting
the characters method is a daunting program challenge.

I would like, if possible, to simply find the words in the paragraph
which was constructed and placed in the cell and change the format
when those words appear. The words would always be the name of a
month, and the numbers would always be dollars. Visual Basic is fine,
as the program is based on macros.

Is there a way to do this that is less cumbersome than counting the
characters before and the length thereof?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change format for an individual word in a cell jaysan3 Excel Discussion (Misc queries) 1 August 28th 09 11:03 AM
How to change column format? numerical not alphabetical ISco Excel Discussion (Misc queries) 3 December 12th 07 07:35 PM
how can I format a cell to change on a specific date ZC New Users to Excel 2 September 16th 07 01:07 AM
convert a numerical currency into word format Rojo Excel Worksheet Functions 1 February 24th 05 11:31 PM
Change format of single word in cell Zenon Excel Programming 1 June 22nd 04 04:02 PM


All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"