#REF error when processing COUNTIFs formula

cochrajl

New Member
Joined
Sep 19, 2014
Messages
27
I have this spreadsheet which combines the contents of six different spreadsheets in a specified location. The way it runs is that I have an Auto_Open routine on Sheet 1 to combine them once I open this spreadsheet.

Where I'm having trouble at is that in Sheet 2 of this spreadsheet, I have a table to set up to run a COUNTIFS formula based on two different sets of criteria. The formula works great when the spreadsheet is open. But once I close the spreadsheet and reopen it, it sets the values to "#REF" because the contents of the spreadsheet are deleted and rebuilt when I open it again. Is there anyway to get around this?

I'll provide more information if needed.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Don't delete the cells, just clear them.
 
Upvote 0
I did try this, but by not deleting the rows, its adding more rows below the contents each time the macro is run.
 
Upvote 0
It's pretty hard for me to comment about a macro I can't see. ;)
 
Upvote 0
I may just add a routine that deletes the cells that do not contain data after all the other routines have ran and all the spreadsheets have been combined.
What code would enable me to do that?
 
Upvote 0
Perhaps you could post what you have and we could see about fixing it?
 
Upvote 0

Forum statistics

Threads
1,214,527
Messages
6,120,058
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top