View Single Post
  #2   Report Post  
Gord Dibben
 
Posts: n/a
Default

Skip

Depends upon the VBA code attached, I would imagine.

If you have worksheet event code that formatted cells, this formatting would
overwrite what you painted with the format painter.

Example...........

Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Num As Long
Dim rng As Range
Dim vRngInput As Variant
Set vRngInput = Intersect(Target, Range("A:A"))
If vRngInput Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
For Each rng In vRngInput
'Determine the color
Select Case rng.Value
Case Is = "A": Num = 10 'green
Case Is = "B": Num = 1 'black
Case Is = "C": Num = 5 'blue
Case Is = "D": Num = 7 'magenta
Case Is = "E": Num = 46 'orange
Case Is = "F": Num = 3 'red
End Select
'Apply the color
rng.Interior.ColorIndex = Num
Next rng
endit:
Application.EnableEvents = True
End Sub

Copy/paste to a worksheet module(right-click on a sheet tab and "view code").

Enter any of the letters a through f in column A.

Color B1 yellow and select it.

D-click on Painter and paint column A.

What is the result?

Gord Dibben Excel MVP


On Tue, 21 Dec 2004 11:11:01 -0800, "Skip Bisconer"
wrote:

When I wish to format several cells the same I double click the format
painter and I am able to format each cell without reclicking the button. I
have just upgraded to Excel 2003 and now I can only do that on a worksheet
that hasn't any VBA code attached. Is this a bug? I know other people on Mr
Excel are having the same problem and no one seems to have an answer. Thanks
for any response or help you may give me.