• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Data Validation - List Box - If yes then run else do nothing

ianb

Member
Hi,


I have a dashboard that updates upon opening.


I also have in a sheet a program that I would like to run only if a list box is chnaged to Yes else No it will just exit sub.


Can you advise on the changes please for this to work.


Private Sub Worksheet_PivotTableUpdate(ByVal target As PivotTable)

Dim Source As Range

Set Source = Range("G101")

If Source Is Nothing Then

Exit Sub

Else

SyncPivotFields2 target

End If

End Sub


Thanks.
 
Hi Ian ,


If the list box is not part of the pivot table , then why link the list box change to the pivot table update event procedure ?


Will any change in the list box mean that the pivot table will be updated ?


If not , then the list box will have its own Change event procedure ; within this , you can check for whether the value is "Yes" or not , and execute the SyncPivotFields2 procedure accordingly ; only , you will have to pass the name of the relevant pivot table to this procedure.


Narayan
 
Private Sub Worksheet_PivotTableUpdate(ByVal target As PivotTable)

SyncPivotFields2 target

End Sub


This is what I started with and I update all pivot tables when I open the spreadsheet.


This program above confilcts with the Opening Refresh of the pivot as this program links vpity tables together and refreshes. I was look for a way to keep my open/refresh and when I want to start the program above I could click a button to start the sync / update pivot table program for only a few pivot tables on each of the spresheet. the program if one item is chnaged e.g date then changes all the other pivot tables. e.g. is the status is changes.... only some of these are linked.


Can you advise or know a solution to this as I keep trying various ways and can not find a way to have both operational. so I have to have Open / Refresh all and then goto the VBA program listed above and un comment to have this working !!!
 
Back
Top