Toggle Font Styles Macro

G

GK80535

I'm not looking to save and restore the background color of th
selection. I'm looking to save and restore the font STYLE.

So, if the font style were red with italics, I want to save and restor
that. If it were blue and bold size 15, I want to save and restor
that.

Does anyone know a function that returns the current selection's fon
style? So, is there a function for which I could do this:

dim myVariable = returnStyleFunction()

??????
 
M

Myrna Larson

The Font object has the properties Name, Size, Italic, Bold, SuperScript,
StrikeThrough, Color, and FontStyle, among others.

Given the example in VBA Help, I think FontStyle returns one of the items from
the list you see in the Font Style box in the Format/Cells/Font dialog. This
would include Regular, Italic, Bold, Bold Italic. Note that it does not
include the font name, size, or color. I suppose you could create a VBA
function that returns an array consisting of the font properties you are
interested in.
 
Top