how use if then
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » How to use an if then with pivot table

How to use an if then with pivot table

resolvedResolved · Urgent Priority · Version 2007

replyReply Tue 31 Jan 2012, 10:08Delegate Tony said...

Tony has attended:
Excel VBA Advanced course

How to use an if then with pivot table

Hi,

This relates to a previous query but I though I would send a new query to make my request clearer.

I am trying to change a pivot table to show either "Sainsbury" or "(blank)" depending on the outcome of a search in a particular range.
I have some of the code but not enough to make it work. Here is where I am so far

IF my search finds "Sainbury" in a range D1:D100 (what is the code for this?)
THEN (is this right?)
ActiveSheet.PivotTables("PivotTable3").PivotFields("Name"). _
CurrentPage = "Sainsbury"
ELSE (is this right?)
ActiveSheet.PivotTables("PivotTable3").PivotFields("Name"). _
CurrentPage = "(blank)"

What is the complete code required to make this work? If the above is not clear enough then please let me know if it is easier to call to explain.

Thanks
Tony

For upcoming training course dates see: Pricing & availability

replyReply Thu 2 Feb 2012, 09:24Trainer Jacob said...

RE: How to use an if then with pivot table

Hi Tony

Thanks for your post and detail. We may be able to help but it does take us beyond the scope of this forum.

We would need to see your actual files and if a solution can be reached we will advise on development time required and associated costs.

If you would like to look into this further please reply to me.

Kind regards

Jacob

 

Please browse our web site to find out more about
ms excel training london and other Microsoft training courses.

Excel tip:

Currency format

Ctrl+Shift+$ applies the Currency format, with two decimal places

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard