Setting pivot table field (current page) to a chosen value

  • Thread starter Thread starter Grant
  • Start date Start date
G

Grant

Hello,

I have the following code:

ActiveSheet.PivotTables("PvtVarianceRpt2").PivotFields
("Line").CurrentPage = cboLine.Name

Where cboLine is a combo drop down list.

It keeps asking for "Object required"

How might I go around fixing this?

Thanks in advance for the replies,
Grant.
 
For a combobox from the Control toolbox:

Dim str As String
str = ActiveSheet.OLEObjects("cboLine").Object.Value

ActiveSheet.PivotTables("PvtVarianceRpt2") _
.PivotFields("Line").CurrentPage = str
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top