Macro related problem....please help...

tifosi18

New Member
Joined
Feb 12, 2009
Messages
9
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
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
So we are letting you down are we by not providing a solution, for free, within 36 miniutes?

Try explaining the problem better.
 
Upvote 0
the problem is that i need the range to be detected automatically while selection of the data and the formatting...

hw to get abt that..??
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top