VBA conditional formatting painter problem
I have placed a conditional format in cell G5 in a pivot table as part of a macro. I then want the format to be painted to all the cells in column G in the pivot table. The number of rows in the pivot table will vary.
Essentially, if column D contains “GBP” I want the format of cells in column G to be in GBP. If column D contains “USD” I want the cells in column G to be in USD.
The problem I have is that the initial cell formats Ok but the painter doesn’t work when I run the macro. The macro stops running when it hits this stage:
This process is part of a larger macro but I have recreated my problem and the following is the code but just for the GBP.
Can anyone help?
' Macro11 Macro
' Keyboard Shortcut: Ctrl+Shift+V
Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
Selection.FormatConditions(1).StopIfTrue = False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
Application.CutCopyMode = False
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By RichTea88 in forum Excel General
Last Post: 01-23-2013, 08:57 AM
By SpecialBrew in forum Excel General
Last Post: 12-04-2012, 09:48 AM
By ih8xc in forum Excel General
Last Post: 12-26-2010, 08:08 PM
By dnnr in forum Excel General
Last Post: 07-14-2007, 03:52 AM
By jaredean in forum Excel General
Last Post: 02-10-2005, 02:46 AM
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1