Filtered Range Overflow Error (Excel 2007)

novel

New Member
Joined
Jan 16, 2012
Messages
39
The code that is causing the issue is this

Code:
visibleEnd = rngFiltered.Range("A1").End(xlDown).Row

visibleEnd is the last row of a filtered range. rngFiltered is the filtered range. it is defined as follows

Code:
Set rngFiltered = Sheets(sname).AutoFilter.Range.Offset(1,0).SpecialCells(xlCellTypeVisible)

sname is a variable to hold the sheet name

In the debugger, the xlDown = -4121 and the entire statement is 1048576, the variable itself is 0 since the error 6 Overflow is occurring.

I'm filtering for blanks and replacing them with a value. The number of rows in my worksheets vary from 200 to 90k+. In this particular instance the number of rows is 7043. There is only blank and it is on this last row in a particular column.

This error only occurs when there is only one row that is returned when the filter executes.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,681
Messages
5,838,780
Members
430,568
Latest member
bortey

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
Top