Solved why am i getting an error on Sub M__TO_Terms_()

August 1, 2018 at 08:06:34
Specs: Windows 10
Dim SL As SlicerCache

For Each SL In ActiveWorkbook.SlicerCaches
SL.ClearManualFilter
Next SL

Application.ScreenUpdating = True

End Sub
Sub M_TO_Terms_()
'
' M_TO_Terms_ Macro
'
Dim PT As PivotTable
Application.ScreenUpdating = False

For Each PT In ActiveSheet.PivotTables

With PT.PivotFields("Academic Year")
.Orientation = xlPageField
.Position = 1
End With

With PT.PivotFields("Term")
.Orientation = xlRowField
.Position = 1
End With
Next SL

Application.ScreenUpdating = False

End Sub


See More: why am i getting an error on Sub M__TO_Terms_()

Reply ↓  Report •

#1
August 1, 2018 at 08:58:51
✔ Best Answer
I'd like to offer a couple of posting tips.

1 - Please click on the How-To link at the end of this post and read the instructions on how to post VBA code in this forum so that it is easier for us to read. Then edit/repost your code so that it looks similar to the example found via that link.

2 - Please keep in mind that we can't see your workbook from where we are sitting nor do we have any of the data that your macro is referencing. Therefore we can't run your macro to see where any problems might be.

In fact, you haven't even told us what error you are getting so we don't even know where to start looking for problems. That's akin to leaving your car at a mechanic's shop with a note that simply says "My car's not working."

The one thing that I can see right away is that you do not have a

Sub macro_name()

line at the beginning of your code, so that is going to cause an error as soon as you try to run

Sub M_TO_Terms_()

If that's your only problem, then you can thank me now. ;-)

If not, you'll need to provide a few more details related to the error wording, when it happens, etc.

How To Post Data or Code ---> Click Here Before Posting Data or VBA Code


Reply ↓  Report •
Related Solutions


Ask Question