Results 1 to 4 of 4

Thread: [Excel]

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    5

    [Excel]

    Is it possible to hide rows in a PivotTable using conditional logic via VBA? If so what command should I be focusing on?

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    46

    Re: [Excel]

    In VB .net through a COM object it is

    Table.pivotfields(YOURFIELDNAME).pivotitems(ROWTOHIDE).visible = false

    I dare say VBA will be very similar, it not the same.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    5

    Re: [Excel]

    Is there any way to do this through an If statement? I tried and If resourcename = " (rolled off)" then Visible = False and it didn't want to work.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Excel]

    If resourcename = " (rolled off)" then Visible = False
    you do not specify what object to make visible
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width