Can vba return excel cell value with formats

Closed
abandonedfriend - Oct 24, 2008 at 12:11 AM
 Nosi - Aug 1, 2010 at 06:12 AM
Hello, I have entered text "ABCDEFGHI" into an Excel cell. I have changed the font of "DEF" to bold. Is there a way for VBA to return the value in the cell along with formatting information.
Sample cell content:

ABCDEFGHI

Thank you.

2 responses

Hi,

information of each letter is found with this parameter:
ActiveCell.Characters(i).Font.Bold 'i is index

This should get you started
13
hint: ActiveCell.Characters(i,j) may have second parameter, length (while first is start position)
0
hi my friend I think it is working try it:

this is for fixing cells and return the value of the cell to the original:

function fixit(cell)
if not cell.hasformula and not isempty(cell) then
fixit=val(cell)
end if
end function
0