|
-
May 30th, 2006, 05:01 PM
#1
Thread Starter
Addicted Member
Problem with Pivot Table
I have the following code, where count is a string defined in order to get some data from a pivot table field:
VB Code:
If other = 0 Then
' first I fill some cells with content 1
Range("B" & 58 + s).Value = Worksheets("Constants").PivotTables("tablereg").GetData(count)
ElseIf other= 1 Then
' first I fill some cells with content 2
Range("B" & 58 + s).Value = Worksheets("Constants").PivotTables("tablereg").GetData(count)
End If
The problem is that for other = 0 the code works perfect, it gets the values from the pivot table. However, for other = 1 it crashes and pops up a error mesage saying that there's a missing bracket. Why does this happen? The code is exactly the same as for other = 0. Simply a copy/paste.
Last edited by Fonty; May 30th, 2006 at 05:32 PM.
-
May 30th, 2006, 05:05 PM
#2
Thread Starter
Addicted Member
Re: Problem with Pivot Table
Could it be that a same instruction for a pivot table cannot be repeated inside an IF?
-
May 30th, 2006, 05:11 PM
#3
Thread Starter
Addicted Member
Re: Problem with Pivot Table
If fact, once the error appears for other = 1, I can see that the value taken by count is exactly the one that results correct for other = 0.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|