PC Review


Reply
Thread Tools Rate Thread

Copy number to pivot table

 
 
Miguel
Guest
Posts: n/a
 
      1st Oct 2009
Hi,
I have a created a macro that uses 3 digit zip codes, copy and paste it to
a pivot table and then copy and paste an estimated number for that specific
zip code. Then the macro does the same process, goes to the next zip code,
copy the zip code to the pivot table and then copy and paste the estimated
number. The problem is that the zip code does not get copy and paste into the
pivot table, it just takes whatever number is in there and estimate the
number that I want for all zip codes. Here's my code. Is there something
worng with it? The name of the worksheet where the zip code comes from is
"RVA", the pivot table is located in the "Census Type", the estimated number
is located in the "RVA" worksheet, and the name of the worksheet where the
number is gotten from is "Summary"
Sub Premium()

startrow = Sheets("RVA").Range("D2")
numrow = Sheets("RVA").Range("E2")

i = startrow

For i = startrow To numrow
Sheets("RVA").Select
Sheets("RVA").Rows(i + 3).Copy
ActiveSheet.Paste Destination:=Worksheets("RVA").Rows(1)
Sheets("Census Input").Select
Range("Q4").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh

Application.Calculation = xlCalculationAutomatic

D24e1 = Sheets("Summary").Range("H19")
Sheets("RVA").Select
Sheets("RVA").Cells(i + 3, 7) = D24e1


Next i

End Sub

Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
from pivot table to vb array copy to new table greegan Microsoft Excel Programming 3 2nd Aug 2010 10:42 PM
Copy PIVOT table? MikeF Microsoft Excel Programming 5 30th Mar 2009 11:31 AM
Pivot Table Number Format =?Utf-8?B?U2FyYWg=?= Microsoft Excel Worksheet Functions 1 14th Jun 2007 10:20 AM
Pivot table - Number of values less than specified value Sean Microsoft Excel Discussion 2 9th Apr 2006 01:27 AM
Pivot table number format JIM.H. Microsoft Excel Programming 0 10th Jun 2004 08:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 AM.