Toggle Font Styles Macro

  • Thread starter Thread starter GK80535
  • Start date Start date
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()

??????
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top