MVB Database or list range not valid

suzq4

New Member
Joined
Jun 9, 2006
Messages
5
I have three separate workbooks for three separate subcontractors, workbook A, workbook B, and workbook C. The layout is the same since the first was developed and the other two 'Saveas' to new file names. All data is entered into a worksheet with the same name in all three files. I found a Macro to separate the data into separate worksheets within the workbook based on Column A. The macro was entered into a separate macro workbook as a Module. I leave the macro workbook open. When I open workbook A, the macro works like a dream. When I close workbook A and open workbook B or C and run the macro, I receive an error "Database or list range not valid'. When I run the debug, it highlights the below code in the macro.

'Get a temporary list of unique values from column A
ws.Columns(vCol).SpecialCells(xlConstants).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=ws.Range("EE1"), Unique:=True

Why will it work for Workbook A but not B or C?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,514
Messages
6,179,225
Members
452,896
Latest member
IGT

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