+ Reply to Thread
Results 1 to 5 of 5

How to Delete all hidden rows and collumn at once by VBA MACRO EXCEL

  1. #1
    Registered User
    Join Date
    12-22-2015
    Location
    lucknow
    MS-Off Ver
    2013
    Posts
    2

    Post How to Delete all hidden rows and collumn at once by VBA MACRO EXCEL

    I am using below code to delete hidden rows, but in my excel i have 1000000 rows it takes hours to delete the rows, do you have any suggestion to improve below code and delete the rows fastest way.

    'Dim iCntr As Long
    'ActiveSheet.Copy
    'For iCntr = 1000000 To 1 Step -1
    'If Rows(iCntr).Hidden = True Then Rows(iCntr).EntireRow.Delete
    'Next

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,379

    Re: How to Delete all hidden rows and collumn at once by VBA MACRO EXCEL

    How about:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    12-22-2015
    Location
    lucknow
    MS-Off Ver
    2013
    Posts
    2

    Re: How to Delete all hidden rows and collumn at once by VBA MACRO EXCEL

    is there any suggestion to remove all row at once(without loop)

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    3,427

    Re: How to Delete all hidden rows and collumn at once by VBA MACRO EXCEL

    Hi pankaj2nit,

    Welcome to the forum!!

    You need to wrap your code in the appropriate tags as xladept and I have. Thanks.

    You can use this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,596

    Re: How to Delete all hidden rows and collumn at once by VBA MACRO EXCEL

    Instead of deleting rows, you could copy only the visible rows to a new sheet.
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Replies: 10
    Last Post: 06-07-2018, 04:16 PM
  2. [SOLVED] Can't delete hidden rows in bulk
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2015, 11:03 AM
  3. Replies: 1
    Last Post: 04-08-2014, 02:50 AM
  4. Replies: 4
    Last Post: 06-11-2010, 03:29 PM
  5. Delete hidden rows & columns
    By tommy_gtr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2007, 06:12 AM
  6. Delete all of collumn after cell...
    By Zlord in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2005, 08:05 PM
  7. Delete Hidden Rows
    By Makeda in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 05-18-2005, 03:03 PM

Tags for this Thread

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