Source ListBox from pivotFields located in another workbook

al.extreme

New Member
Joined
Nov 29, 2010
Messages
15
I have a userform with two ListBoxs for item transfer (from selected items on the list on the left to the blank list on the right)


Sub ShowDialog()
UserForm1.ListBox1.RowSource = ""
' Add some items to the ListBox
With UserForm1.ListBox1
.RowSource = ""
.AddItem "January"
.AddItem "February"
.AddItem "March"
End With
UserForm1.Show
End Sub



I need help to feed the ListBox1 with the PivotItems, from a different workbook. This is my data source:

Windows(wb2).Activate
SelectPivot 'this is my function to select the tab containint the pivot
ActiveSheet.PivotTables("PivotTable1").PivotFields("Calendar Year/Week")

Instead of having the default "January", "February", "March"... I want to select a couple pivotFields (from a list of aprox. 50 pivot fields) from workbook "wb2"

any help ?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
refrasing my question and using what could be an easier method:

how can I copy the full list of pivot items from "pivottable1" in workbook "wb2" and paste them in "sheet1", cell A1 in workbook 1 ?

after that, I guess is easier to reference the listbox, right?

any hints?
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top