Thread: When to Stop
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default When to Stop

Assume the formula is in Cell H5
Dim rng as Range, lastRow as Long
set rng = Activesheet.PivotTables(1).TableRange1

lastrow = rng.rows(rng.rows.count).row
Range("H5:H" & lastrow).Formula = Range("H5").formula

--
Regards,
Tom Ogilvy

"Keith" wrote in message
...
I have a macro that updates two pivot tables that are side
by side. Next to the tables is a calculated field based
on the two tables. Once the tables have been updated the
column with the calculated field needs to have the
calculation copied down to the bottom of the now longer
pivot tables.

Is there anyway to automate this? I need the copying to
stop at the same row the pivot tables stop.