LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Loading pivotfields from an array

I'm using th code below, is this the most efficient way to use the array?

Sub Load_PivotFields()
Dim DataFieldArray As Variant, Pivot_Field As String, Sht_Select As String
Application.ScreenUpdating = False
Sheets("Formulas").Select
DataFieldArray = Range(Cells(100, 1), Cells(147, 8)).Value
For w = 1 To 8
ActiveSheet.Next.Select
Sht_Select = ActiveSheet.Name
For x = 1 To UBound(DataFieldArray)
Pivot_Field = DataFieldArray(x, w)
ActiveSheet.PivotTables("PivotTable1").AddDataFiel d
ActiveSheet.PivotTables("PivotTable1").PivotFields (Pivot_Field), "Sum of " &
Pivot_Field, xlSum
Nex x
Next w
Application.ScreenUpdating = True
End Sub

--
Helping Is always a good thing
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading Data into an Array QuietMan Excel Programming 1 May 20th 09 05:59 PM
Problems Loading Large String Array into Array variable ExcelMonkey Excel Programming 6 May 6th 09 11:12 PM
Loading an Array Chad Cameron[_4_] Excel Programming 3 December 9th 07 04:13 PM
Loading array into list box r wilcox Excel Programming 5 June 20th 05 11:14 PM
Loading Excel Array from VB Array Faster ExcelMonkey[_3_] Excel Programming 3 January 22nd 04 02:49 AM


All times are GMT +1. The time now is 11:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"