My add-on note not exactly how to do it (as i guess, by default its may not works), but a little trick about Excel vs. Underline... Because whatever method you try to decide the underline, may you need take care of one little bit...1st: underline is not Boolean
, but some 'style' value. Like Underlined = 2, double underlined = 5, etc... The not underlined is -4142... 2nd:
and IF just part of the text is underlined (example, only the 2nd word), so its 'mixed', the result is null
So, may wort to check to booth cases...
I do some similar case in the past with the following way: i create a small VBA Excel macro, its check the cell is has some formatting, and if it is, its copy the cell value to new column (so, practically its 'cleanup' the data).Example VBA (Excel) script:
Code: Select all
' underline_checker Macro andras.csore
' in Excel the Font.Underline value is not Boolean, but its the style of the underline (single, double, etc...)
' The not underline return value is : -4142
Dim underline_type As Integer
For ciklus = 1 To 3
If IsNull(Cells(2, ciklus).Font.Underline) = True Then ' Null return if only a part of the cell value is underlined...
underline_type = 0
underline_type = Cells(2, ciklus).Font.Underline
If underline_type <> -4142 Then ' If not equal with no underline, we write-out (print) to another column...
Cells(2, ciklus + 4).Value = Cells(2, ciklus).Value
The small code check the row=2, col 1..3, put cell value to new columns (5..7) if its underlined...
However, i think may the best solution to implement some similar code with java library code for that (like jExcel, etc...)?
p.s.: may if the formatting is not 'hardcoded', but Excel conditional formatting, some 3rd party library may not parse this conditional formatting well. But if its conditional, may you also able to build the logic for that...