I have a pivot table w/ 20 columns. I have a macro that adds a column in Column 21 and inserts a column heading and necessary calculations. That works fine.
However, I then highlight the 20th column and try to paste the formats into Column 21 and it doesn't work. I do it manually and it works fine. I do it manually and record a macro and it works fine...I run the macro...it doesn't work.
Here's the part of my code that copies and pastes....Any ideas? Is this a glitch in Excel 2007?
Range(Cells(11, Sheets("notes").Range("C4").Value), Cells(Bottom + 1, Sheets("notes").Range("C4").Value)).Select
Selection.Copy
Sheets("Report").Range(Cells(11, RightEdge + 1), Cells(Bottom + 1, RightEdge + 1)).Select
Selection.PasteSpecial Paste:=xlPasteFormats
However, I then highlight the 20th column and try to paste the formats into Column 21 and it doesn't work. I do it manually and it works fine. I do it manually and record a macro and it works fine...I run the macro...it doesn't work.
Here's the part of my code that copies and pastes....Any ideas? Is this a glitch in Excel 2007?
Range(Cells(11, Sheets("notes").Range("C4").Value), Cells(Bottom + 1, Sheets("notes").Range("C4").Value)).Select
Selection.Copy
Sheets("Report").Range(Cells(11, RightEdge + 1), Cells(Bottom + 1, RightEdge + 1)).Select
Selection.PasteSpecial Paste:=xlPasteFormats