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

Susan Welsh  Identity Verified
United States
Local time: 10:36
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: 16:36
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: 10:36
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






BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »
PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »



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