Seamus2626
asked on
VBA Help
Hi,
Im trying to exit a sub If ActiveSheet.Range("C92") = "0" Then
Ikeep getting that pesky error "next without for" on Next i
OIm a novice vba user, so any help would be great!
Im trying to exit a sub If ActiveSheet.Range("C92") = "0" Then
Ikeep getting that pesky error "next without for" on Next i
OIm a novice vba user, so any help would be great!
Sub Step_Thru_Booked()
Dim slItem As SlicerItem
Dim i As Long
Range("U23").Value = "=J2"
Call Hide_All
ActiveWorkbook.RefreshAll
With ActiveWorkbook.SlicerCaches("Slicer_PCM_In_Country_Sales_Manager")
'--deselect all items except the first
.SlicerItems(1).Selected = True
For Each slItem In .VisibleSlicerItems
If slItem.Name <> .SlicerItems(1).Name Then _
slItem.Selected = False
Next slItem
Call Print_PDF_Booked
'--step through each item and run custom function
For i = 2 To .SlicerItems.Count
.SlicerItems(i).Selected = True
.SlicerItems(i - 1).Selected = False
If ActiveSheet.Range("C92") = "0" Then
Exit Sub
Else
Call Print_PDF_Booked
Next i
End With
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER