How to get all formatting back from a cell in Excel using VBA?
How can I use VBA to return all formatting information about a cell in Excel. For example:
I need to know which text is purple, green, and which is breaking through. Range("B2").Value
only returns plain text. I also need formatting.
it is best to use Intellisense to explore all the values โโavailable to you. You can complete the code snippet below, with such things as .Color
, .Strikethrough
, .Bold
etc and print them out the nearest window. (Ctrl + G displays the immediate window if it is not currently displayed)
Sub test()
debug.Print Range("B1").Font 'finish this line with any of the IntelliSense options to learn things about the text
End Sub
You can also look at the properties listed on the MDSN site for the font object