How to sort table in MS Word 2003 by cell colour
Thread poster: Samuel Murray

Samuel Murray  Identity Verified
Netherlands
Local time: 18:40
Member (2006)
English to Afrikaans
+ ...
Sep 11, 2015

Hello everyone

Do you know of a macro that will sort a table by the cell colour of the sort-by column? I know that I can do this in Excel 2010, and it would appear that it may be possible in Word 2010 as well, but I would like to do it in Word 2003. Do you know of a way?

The table I'm trying to sort, is this type:
http://wikisend.com/download/172728/sample%20file.doc
I want to sort it so that all purple coloured cells are grouped together.

Thanks
Samuel


[Edited at 2015-09-11 10:12 GMT]


Direct link Reply with quote
 

Heinrich Pesch  Identity Verified
Finland
Local time: 19:40
Member (2003)
Finnish to German
+ ...
That I would like to know too :) Sep 11, 2015

Often I would like to remove cells from External Review files with green or brown background color.

Direct link Reply with quote
 

andrejc  Identity Verified
Slovenia
Local time: 18:40
German to Slovenian
+ ...
Sort by colour Sep 11, 2015

Perhaps one of the options would be to copy table into Excel (even if it is a newer version), do the sorting and than copy the sorted table back to Word (2003). I did not find it in Word (2007)

[urejeno ob 2015-09-11 11:40 GMT]


Direct link Reply with quote
 

xxx2nl  Identity Verified
Netherlands
Local time: 18:40
Something like this? Sep 11, 2015

You are familiar with VBA, aren't you?

Something like this should do the trick:

For every cell in column(4)

if background colour = purple, cell.text = "mod"
elseif background colour = yellow, cell.text = "fuzzy"
elseif background colour = green, cell.text = "exact

Next


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 18:40
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
@2nl Sep 11, 2015

2nl wrote:
You are familiar with VBA, aren't you?


My "familiarity" with VBA does not extend to knowing VBA syntax, no.


Direct link Reply with quote
 

andrejc  Identity Verified
Slovenia
Local time: 18:40
German to Slovenian
+ ...
Sort by colour Sep 11, 2015

How many lines do you have?

Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 18:40
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
@Andrejc Sep 11, 2015

andrejc wrote:
Perhaps one of the options would be to copy table into Excel...


Yes, but that is an option that I would like to avoid. It works (I can copy/paste from Word 2003 to Excel 2010 and back, but it requires careful mousework otherwise the table breaks, and pasting from Excel messes with the cell margins of the table in Word).

andrejc wrote:
How many lines do you have?


I'm not sure I understand the question. The tables can be of any size (rarely more than 2000 lines, though).


[Edited at 2015-09-11 13:45 GMT]


Direct link Reply with quote
 

Adrien Esparron
Local time: 18:40
Member (2007)
German to French
+ ...
Some ideas Sep 14, 2015

I'm afraid it's not possible with Word 2003 because it's very difficult to return the fields background color value (and then do a numeric sort).

Even if it's not "your" solution, you can do it with Excel 2003 :

http://datapigtechnologies.com/blog/index.php/sort-by-color-in-excel-2003/

To avoid the pasting back problems in Word, you can use the Paste special function with link to the Excel worksheet after having sorted it.

I tried with your sample with the 2003 versions and it works.

Have fun!


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 »

How to sort table in MS Word 2003 by cell colour

Advanced search






Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

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