Overflow Error in VBA

kstrain

New Member
Joined
Sep 20, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I have a macro written that combines all lines below the header row into a new "Master" tab. It has worked on previous files until now. The total rows of data I am moving into my Master tab is 39,547 lines. While running my macro, I receive an error message stating Overflow. It is giving an error message on this step highlighted below. Why is it now giving an error on this file but hasn't on past files? The # of lines is still below the 65536 rows listed in part of the code and the file size is actually 1048576 (as have the other files that I have ran this macro on and they haven't given any error messages).

1663718045188.png
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You probably need to declare:
VBA Code:
Dim i as long

Instead of:
VBA Code:
Dim i as Integer
 
Upvote 0
Solution
I currently use Dim lastrow as Long to add formulas to multiple columns/rows. Can I put both in my macro without error?
 
Upvote 0
MAybe this way
VBA Code:
Sub Del_Rows()
  On Error Resume Next
  Range("A1", Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlBlanks).EntireRow.Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,375
Members
448,888
Latest member
Arle8907

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