I have a table in Word. What I would like to do is to sum the numbers from the rows that were highlighted (in only one column). I found on the internet the way to sum the content of the cells if they have specific background color, and then using this thread I changed the function so that it checks for the highlight color, not background. That's what I created:
Function ColorIndex(Rng As Range)
ColorIndex = Rng.Interior.ColorIndex
End Function
But, then when I wanted to check if it works in Excel, I realised that in Excel there is no 'higlight the text' option at all. It made me realise that probably the function would not be doing what I want anyway, I checked and as I expected, it would return the color of the cell background. Therefore, I wanted to see if the function will work in Word, but apparently you can only use some pre-programmed functions in Word, and I cannot choose the function I created in VBA using Insert -> Module. That's why I have two questions:
1) Is it possible to use a function created by VBA in Word table and if yes, how to do it?
2) Is there a way to have a function that would check whether the text is highlighted?