'Object variable or With block variable not set' error when setting a range in VBA
- by David Gard
I have a function that creates a Pivot Table, but I am getting an error when I try to set a range that will be merged and have a title added to it.
In the below code, pivot_title_range is a 'String' variable, and is optional when calling the funtion. title_range is a 'Range' variable. Both lines that set the range (whether or not the users…