On Error Resume Next

J

Jasper

Hello everybody!

I was wondering if someone could help me with the following. I wrote a macro
which get's information with matches the criteria k from a Pivot Table. I've
named K allready. Though it only returns "(Blank)" the criteria I stated in
case K was not found. I tested it with criterias which were sure to have
results but did not get any reslults other than (blank) either.

I think it has got something to do with the "On Error Resume Next" I used
but cant figure out what.

Application.CommandBars("PivotTable").Visible = False
On Error Resume Next
ActiveSheet.PivotTables("PivotTable1").PivotFields("ARF Code").CurrentPage =
"" & k & ""
On Error Resume Next
ActiveSheet.PivotTables("PivotTable1").PivotFields("ARF Code").CurrentPage =
"(blank)"
On Error GoTo 0
Application.CommandBars("PivotTable").Visible = False


Thanks in Advance!!
 

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

Top