hi
i hv created a macro for a wrkbook involving three sheets. the first being the master sheet the second is a pivot table sheet.
now by the macro i aim to automate the process of selecting the data from the pivot table sheet and copy it to the third sheet and then format this data to a preset format by format painter and then select all this data.
the problem i face after creating this macro is that it fails to work if there is any addition or deletion of a row in the master data sheet.
im not familiar with VBA programmin so please tell me hw to solve this...
the macro code is...
Sub Financial()
'
' Financial Macro
' Macro recorded 2/12/2009 by Accenture
'
'
ActiveSheet.PivotTables("PivotTable1").PivotFields("Category").CurrentPage = _
"Financial"
Range("A6:N18").Select
Selection.Copy
Sheets("RR_Copy").Select
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("P6").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("P6:P18"), Type:=xlFillDefault
Range("P6:P18").Select
Range("B6:O6").Select
Selection.Copy
Range("B7:O18").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("B6:P18").Select
End Sub
i hv created a macro for a wrkbook involving three sheets. the first being the master sheet the second is a pivot table sheet.
now by the macro i aim to automate the process of selecting the data from the pivot table sheet and copy it to the third sheet and then format this data to a preset format by format painter and then select all this data.
the problem i face after creating this macro is that it fails to work if there is any addition or deletion of a row in the master data sheet.
im not familiar with VBA programmin so please tell me hw to solve this...
the macro code is...
Sub Financial()
'
' Financial Macro
' Macro recorded 2/12/2009 by Accenture
'
'
ActiveSheet.PivotTables("PivotTable1").PivotFields("Category").CurrentPage = _
"Financial"
Range("A6:N18").Select
Selection.Copy
Sheets("RR_Copy").Select
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("P6").Select
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("P6:P18"), Type:=xlFillDefault
Range("P6:P18").Select
Range("B6:O6").Select
Selection.Copy
Range("B7:O18").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("B6:P18").Select
End Sub