Results 1 to 10 of 10

Else without IF

Threaded View

Aland2929 Else without IF 02-28-2012, 05:22 AM
johnjohns Re: Else without IF 02-28-2012, 05:27 AM
Aland2929 Re: Else without IF 02-28-2012, 05:37 AM
JapanDave Re: Else without IF 02-28-2012, 05:49 AM
mohan.r1980 Re: Else without IF 02-28-2012, 05:49 AM
Aland2929 Re: Else without IF 02-28-2012, 05:59 AM
royUK Re: Else without IF 02-28-2012, 06:02 AM
Aland2929 Re: Else without IF 02-28-2012, 06:06 AM
Aland2929 Re: Else without IF 02-28-2012, 06:19 AM
JapanDave Re: Else without IF 02-28-2012, 06:22 AM
  1. #1
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    858

    Else without IF

    I am receiving a compile error: Else without IF but can't see the error?

    Sub ByRegionCategory()
    ' Display by Region and category
        Application.ScreenUpdating = False
        If Range("Trigger1") = True Then
        With ActiveSheet.PivotTables("PivotTable1").PivotFields("Detail").Orientation = _
            xlHidden
            .PivotFields ("Region")
            .Orientation = xlRowField
            .Position = 1
            .PivotFields ("Category")
            .Orientation = xlRowField
            .Position = 2
        
        ElseIf Range("Trigger1") = False Then
        ActiveSheet.PivotTables("PivotTable1").PivotFields("Detail").Orientation = _
            xlHidden
        With ActiveSheet.PivotTables("PivotTable1").PivotFields("Category")
            .Orientation = xlRowField
            .Position = 1
        
            .PivotFields ("Region")
            .Orientation = xlRowField
            .Position = 2
        End If
    End Sub
    Thanks in advance
    Last edited by Aland2929; 02-28-2012 at 06:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1