Type Mismatch/ ByRef Pivot Table error on one Pivot Table and not others – Excel VBA

  Kiến thức lập trình

I’m working on a macro used to update and format pivot table. I’ve created a “Reset Workbook” sub procedure and I’m wanting to pass in the pivot tables I’ve already declared. I’m getting a “ByRef” error. I’m only getting the error on one of my pivot tables, the “Actual Ship” Pivot Table.

My Code

I’ve tried adding “ByVal” before passing it in, and after adding it I have a “Type Mismatch” error. I’ve tried moving around the variables in the declaration and call around. I’m sure the answer is simple, but I’m confused.

LEAVE A COMMENT