I don't understand what you mean about selecting the sheet for the
data|validation stuff.
I would have guessed that you set up data|validation manually (using a range
name on that other sheet). Then that other sheet doesn't have to be selected.
And maybe if you have two cells and two page fields:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("E1,F1")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Select Case LCase(Target.Address(0, 0))
Case Is = "e1"
Worksheets("sheet2").PivotTables("Pivottable1") _
.PageFields("Name1").CurrentPage = Target.Value
Case Is = "f1"
Worksheets("sheet2").PivotTables("Pivottable1") _
.PageFields("Name2").CurrentPage = Target.Value
End Select
Application.EnableEvents = True
End Sub
(untested, but it did compile.)
The offset formula worked for the size of the list.
I can't hide the sheet because it select the sheet in the command for the
data validation.
How can I include two data validation fields that make a pivot table action?
I copied the code but it didn't work.
Thanks again,
FA