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

Susan Welsh  Identity Verified
United States
Local time: 04:41
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?


 

Tony M
France
Local time: 10:41
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]


 

Susan Welsh  Identity Verified
United States
Local time: 04:41
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.


 


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






SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running, helps experienced users make the most of the powerful features, ensures new

More info »
SDL MultiTerm 2019
Guarantee a unified, consistent and high-quality translation with terminology software by the industry leaders.

SDL MultiTerm 2019 allows translators to create one central location to store and manage multilingual terminology, and with SDL MultiTerm Extract 2019 you can automatically create term lists from your existing documentation to save time.

More info »



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