View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default How do I cut a portion of text out of a cell?

I don't think I'd base anything on the actual editing of the value--since no
macro can help with that.

But if there are certain words that always get bolded (and always get bolded
whenever they're used), you could use a macro--essentially a series of
edit|replaces:

select the range
edit|replace
what: _example_ (_ represents a space character)
with: _<strongexample</strong_
replace all

Or depending on how you generater this GIFT file (never heard of this), you may
be able to do the same thing while you're creating the file.



jeff wrote:

It would be selected, while you are in the cell, actually typing in the text,
and you would either hold down shift and use the cursor keys to choose your
text within the cell, or use the mouse to choose the text I want.

Here are more specific details of what I am really trying to accomplish, in
case there is another way to do it:

Basically, we are writing questions, and are exporting them in a text file
(GIFT format) that will be imported into another program. If I BOLD a word in
the cell, when it is exported into the text file it gets stripped of the
BOLD. The program we are importing into uses HTML tags, so while I am
entering my question into Excel, I want to be able to put <strong on the
left side of my cursor, and </strong on the right side of cursor. I can then
type the word I want to be BOLDed in between <strong and </strong, and when
I export the text file, it will contain this formatting.

"Dave Peterson" wrote:

When you're editing that cell, no real macros can run.

You may be able to accomplish it another way--if you share the rules of how you
selected that "example" text.



jeff wrote:

This is probably an easy question for you experts out there...

I have the following text in cell C3: "This is example text."

I select cell C3 with the mouse, then press F2 to edit, and then select the
word 'example' with the mouse. Here's my problem... I now want to run a macro
(in the Right-Click mouse menu), which will:

1) Cut the selected text out
2) Add the letters "AA" to the beginnning of this cut text
3) Add the letters "BB" to the end of this cut text
4) Reinsert the new text back into the original text, so the text in cell C3
would now read "This is AAexampleBB text."

Any help would be appreciated.
Thanks


--

Dave Peterson


--

Dave Peterson