Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Skip Bisconer
 
Posts: n/a
Default Format Painter button problem

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.


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


  #3   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

The format painter seems to work as expected in Excel 2003.

What kind of code is attached to the sheets in which you're having a
problem?

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.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #4   Report Post  
Skip Bisconer
 
Posts: n/a
Default

I had some code to format text to red if amounts were lower than 0. I have
since changed to condition formatting to accomplish this task rather than
VBA. As soon as I removed them the double click process worked fine. I have
tried some of my other older worksheets that had similar formating cells with
code and the double click works on those. Mysitical? I have Peasons functions
for changing text colors based on value and never had a problem before. I
guess it was just me.

Thanks for your help. It did solve my problem.:)



"Gord Dibben" wrote:

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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Conditional format deletion [email protected] Excel Discussion (Misc queries) 3 December 13th 04 05:10 PM
excel format cells/Number/Category: Number problem Matts Excel Discussion (Misc queries) 5 December 9th 04 09:47 PM
Problem with Date format from VBA code twig Excel Discussion (Misc queries) 3 December 7th 04 06:01 PM
cut and paste format problem Francis Hayes (The Excel Addict) Excel Discussion (Misc queries) 1 December 7th 04 02:23 PM
cell format problem kumarappans Excel Discussion (Misc queries) 3 November 26th 04 05:36 PM


All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"