Fonty
May 30th, 2006, 05:01 PM
I have the following code, where count is a string defined in order to get some data from a pivot table field:
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.
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.