Excel 2010 - macro to change font of selected words
Thread poster: Susan Welsh

Susan Welsh  Identity Verified
United States
Local time: 11:42
Member (2008)
Russian to English
+ ...
May 23, 2012

Is it possible to write a macro to change the font of only selected words in an Excel cell?

I have a client that wants checking of a translation, with source text in one Excel column and target text in the second column. Every cell that has something in it that is changed has to be highlighted in yellow and the word or words that are changed by the editor (me) have to be changed to red font.

This is very tedious, and it took me 1.5 hours to review some 700 words of very easy text, mainly because of all the mousing about. I have studied up on macros, and managed to create macros for the yellow highlighting (on and off), and to change the black font to red and back to black again in the WHOLE cell. But I don't want the whole cell, only the selected words.

Any suggestions?


Direct link Reply with quote
 

Tony M  Identity Verified
France
Local time: 17:42
Member
French to English
+ ...
Styles... May 23, 2012

I'm not familiar with Excel 2007, nor in particular with using styles in Excel; but can't you simply defined a 'changed word' style, and assign it to a specific keyboard short cut? That ought to do the trick, without need to actually write a custom macro.

However, I have to emphasize that I've never actually tried it!

Alternatively, copy the text out to Word, do the manipulation there, and then copy it back across; the cell b/g colour will still have to be done manually, but the other text formatting should be easier to achieve in Word, and should be preserved when you copy back. If you were lucky, you might even be able to find a way to do it using 'Track changes' — for example, do a search-&-replace-all on the 'added text' style in T/c, replacing it with say the colour or other font style you want; then 'accept all changes in document'. You'll have to see if something like that is feasible, but it might be the quickest way.

Then copy it all back to Excel at the end, of course!

Warning! Will cause havoc if there are merged cells or manual line breaks within Excel cells!

[Edited at 2012-05-23 12:56 GMT]


Direct link Reply with quote
 

Susan Welsh  Identity Verified
United States
Local time: 11:42
Member (2008)
Russian to English
+ ...
TOPIC STARTER
update May 24, 2012

Thanks for your reply, Tony.
Apparently there is no way to assign a keyboard shortcut in Excel--that's what an expert friend told me, and I certainly don't know how to do it.
The method of moving the whole thing to MS Word works (my friend gave me step-by-step instructions, involving Styles), but as you point out, there are dangers lurking there. He said he tried the "track changes" route and it did not succeed.

But the good news is, I complained so loudly about this to the client agency, that they decided I didn't need to bother with the red fonts anymore, just the yellow fill in cells that are changed. My new macro works for that, so I'm all set. Hopefully this will greatly speed up the process.


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Excel 2010 - macro to change font of selected words

Advanced search






TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search