VBA Queston on Formatting Macro

I'm trying to figure out how to create a few handy macros

for my job at work. I've done a little VBA programming before, but its been a

few years since I've touched it, so I could really use some help. I'm looking

to create a host of macros that will cycle through different formatting

options. For example, I want to create a macro, link it to cntrl+shift+F that

will modify the fill color the following way:

cntrl+shift+F > when keyed the first time, background fill turns gray

(25%)

cntrl+shift+F > when keyed the second time, fill turns to light blue

cntrl+shift+F > then light yellow

cntrl+shift+F > then no fill

cntrl+shift+F > then gray (25%) again, etc...looping through the options

I want to do this for all sorts of formatting such as cycling through alignment

options, text color, fill color, number format, borders, etc. I figure that if

I can get some help on how the general format goes, I can go back and figure

out the code for fill vs. text color vs. whatever.

I also want to create macros that will increase/decrease the decimal place

every time it’s keyed and zoom in/zoom out every time it’s keyed.

Any help that you can give me would be great, and the sooner the better!

Thanks!

rgrandle21@hotmail.com.(donotspam)

[1359 byte] By [rgrandle] at [2007-12-23]
# 1
This will change the fill colors of the current selection:

With Selection.Interior
If .ColorIndex = xlNone Then
.ColorIndex = 15 'gray 25%
ElseIf .ColorIndex = 15 Then
.ColorIndex = 41 'light blue
ElseIf .ColorIndex = 41 Then
.ColorIndex = 36 'light yellow
ElseIf .ColorIndex = 36 Then
.ColorIndex = xlNone 'no fill
End If
End With

For the rest I would use the macro recorder to see what code it gives and go from there.

hth

Navajo at 2007-8-30 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...