PDA

View Full Version : Worksheet event code to copy Formula



adamsm
07-28-2010, 07:40 AM
Hi,


I’m using the following formula to count the visible columns in a pivot table.


I’ve set the date as the column headers which means, whenever a new date to the sheet related with the pivot table is added a new column too gets inserted into the pivot table upon refresh.

This moves the column heading from let’s say for example K10 to L10.

My question of concern is how could I create a Worksheet event code that would change the formula from =Sum_Visible_Cells(A10:J10)to
=Sum_Visible_Cells(A10:K10) as the “Grand Total” moves from column “K” to “L”

Thanks in advance.