Broken notes
New Member
- Joined
- Dec 21, 2016
- Messages
- 3
Hello all,
I am trying to add value fields to a pivot table via a macro run from a user form (just named ranges on a worksheet), and I am having trouble finding a way to select what value field type is required ie sum, count etc.
The line specifies the sheet containing the pivot and the pivot name (both referencing named ranges where the user inputs this information), adds the field and the final term (currently xlSum) specifies the value field type. I want this final term to come from a referenced named range also ( for example Range("value_field_type).Value). however no matter what I try I can't get this to work (the fields do not populate). If the term is left as xlSum it works just fine.
Any ideas?
Any help would be much appreciated.
Cheers!
I am trying to add value fields to a pivot table via a macro run from a user form (just named ranges on a worksheet), and I am having trouble finding a way to select what value field type is required ie sum, count etc.
The line specifies the sheet containing the pivot and the pivot name (both referencing named ranges where the user inputs this information), adds the field and the final term (currently xlSum) specifies the value field type. I want this final term to come from a referenced named range also ( for example Range("value_field_type).Value). however no matter what I try I can't get this to work (the fields do not populate). If the term is left as xlSum it works just fine.
Any ideas?
Any help would be much appreciated.
Cheers!