Hello my dear members,
How do I output the value in a cell into a message box? Column reference of that cell is column F and Row reference is that of a sheet changed row in column B.
But the problem is that I am dealing with pivot tables. Pivot table will always comprise of two cells adjacent to one another. In this case it is Cell A5 and Cell B5.
A5 = Report Filter Label
B5 = Report Filter Values
Now if I hadn't have the pivot tables the following would have worked just fine..
However when the target address in column B is not just a normal cell but a pivot table dropdown. This vba won't work and output me type mismatch error
To output the Report Filter Value itself the following line will do it for me..
So this will output me message box = Your result is "Value in B5 which is a pivot filter value"
But I want the value in F5 instead which is a non pivot filter value and just a normal cell.
Will appreciate.
Anyone?
How do I output the value in a cell into a message box? Column reference of that cell is column F and Row reference is that of a sheet changed row in column B.
But the problem is that I am dealing with pivot tables. Pivot table will always comprise of two cells adjacent to one another. In this case it is Cell A5 and Cell B5.
A5 = Report Filter Label
B5 = Report Filter Values
Now if I hadn't have the pivot tables the following would have worked just fine..
VBA Code:
If Not Intersect(Target, Range("B5:B100")) Is Nothing Then
MsgBox "Your result is " & Range(Target.Address).Offset(0, 5).Value
However when the target address in column B is not just a normal cell but a pivot table dropdown. This vba won't work and output me type mismatch error
To output the Report Filter Value itself the following line will do it for me..
VBA Code:
MsgBox "Your result is " & Target.Offset(0, 1).PivotItem.Value
So this will output me message box = Your result is "Value in B5 which is a pivot filter value"
But I want the value in F5 instead which is a non pivot filter value and just a normal cell.
Will appreciate.
Anyone?