+ Reply to Thread
Results 1 to 6 of 6

Deleting Row from Huge data

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    34

    Deleting Row from Huge data

    Hi have a Excel fill (size 80 MB), which have around 450000 row of data. There are few blank row randomly which i Need to remove/delete.

    The code i have is as below which works fine for small data. but for huge data it gives me Overflow error.

    Sub DeleteRow()

    Application.ScreenUpdating = False
    Dim i As Integer
    Dim Lastrow As Long
    Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
    For i = Lastrow To 1 Step -1
    If Cells(i, 1).Value = "" Then
    Rows(i).Delete
    End If
    Next
    Application.ScreenUpdating = True

    End Sub

    Hence request you to give me code which i can you for 450000 row in a file

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Deleting Row from Huge data

    Try this:
    Please Login or Register  to view this content.


    Oh, and please use code tags around your code, when posting: Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    34

    Re: Deleting Row from Huge data

    I am getting the below error

    "Can't execute code in break mode"

    Untitled233.png

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Deleting Row from Huge data

    Are you stepping through the code, with F8? Try just running the macro.

  5. #5
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    34

    Re: Deleting Row from Huge data

    No. But numbers of row(more then 300000) may causing problems

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Deleting Row from Huge data

    Quote Originally Posted by ErgoTeam View Post
    No. But numbers of row(more then 300000) may causing problems
    What makes you think that? I tested it on a dataset of 450,000 rows, with no problems...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. excel deleting zeros - this is a huge problem :)
    By oneandtwo in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-03-2015, 09:15 AM
  2. How to go End of Huge Data Range?
    By crwiseman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-31-2014, 04:57 PM
  3. Replies: 2
    Last Post: 06-12-2013, 07:41 AM
  4. I need help. Huge data source, I need to clean it up. Find and move data macro.
    By sangreal2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 02:26 PM
  5. How to go End of Huge Data Range?
    By crwiseman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2006, 01:40 PM
  6. huge huge excel file... why?
    By Josh in forum Excel General
    Replies: 12
    Last Post: 02-09-2006, 06:00 PM
  7. Huge size data
    By shanana in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-10-2005, 11:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1