Error 2007

M

mju

Help!!!

This macro used to work perfectly fine. Nothing has changed. All of a
sudden, I am getting a type mismatch(error 2007).

I don’t know how to fix this.

Sample of my code:


Range("A4").Select
With ActiveSheet.PivotTables("PivotTable4").PivotFields("ST-LOC-NUMB")
.PivotItems("(blank)").Visible = False
End With
Range("A1").Select
ActiveCell.FormulaR1C1 = "=AVERAGE(R[2]C:R[9998]C)"
Range("A1").Select
Selection.autofill Destination:=Range("A1:M1"), Type:=xlFillDefault
Range("A1:M1").Select
Range("A2").Select
ActiveCell.FormulaR1C1 = "=COUNTA(R[1]C:R[9998]C)"
Range("A2").Select
Selection.autofill Destination:=Range("A2:M2"), Type:=xlFillDefault
Range("A2:M2").Select
Range("c3").Select

End If
'UPS_ANS = store shipping

This is the location of the error.
If Range("m1") >= 80 Then
GoSub Movesub

ElseIf UPS_ANS = "Yes" Then
Range("L4").Select

ActiveSheet.PivotTables("PivotTable4").PivotFields("ST-LOC-NUMB").Orientation
= _
xlHidden
Else

Range("L4").Select

ActiveSheet.PivotTables("PivotTable4").PivotFields("UPC").Orientation = _
xlHidden
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top