Macro that creates creates a row and paste formulas

mosh

Registered User.
Local time
Today, 11:42
Joined
Aug 22, 2005
Messages
133
Hello All,

I have a Pivot table that updates every week, but I also have two columns connected to the pivot but if a new row is created as a result of the pivot update, I want a row created to calculate the value.

here is what I have so far, all it does it drags the total values and then drags the formula above the total formula down one;


Range("G22:H22").Select
Selection.Cut Destination:=Range("G23:H23")
Range("G21:H21").Select
Selection.AutoFill Destination:=Range("G21:H22"), Type:=xlFillDefault
Range("G21:H22").Select
End Sub

So when the pivot is updated, If a new value (week ending) date is created then follow the above.

Thanks for your help,
________
LIVE SEX
 
Last edited:
Mosh, i am confused as to what you are trying to achieve with that code.

Did you record it? Are you asking if the code can adapt to where the new row appears and not be prescribed? sorryrather wooly for a sunday evening
 
Mosh, i am confused as to what you are trying to achieve with that code.

Did you record it? Are you asking if the code can adapt to where the new row appears and not be prescribed? sorryrather wooly for a sunday evening

Hi Sam,

I initially recorded it yes. Your on the right lines, If a new row appears then carry on with the code.

Thanks
________
Live sex webshows
 
Last edited:
Hi Sam,

I initially recorded it yes. Your on the right lines, If a new row appears then carry on with the code.

Thanks

Mosh, is this a formula that cannot actaully be built into the pivot table? Are you using data within the table to calculate a further field? as adding a formula TO the pivot table would be easier.
 

Users who are viewing this thread

Back
Top Bottom