+ Reply to Thread
Results 1 to 4 of 4

VBA macro to delete all empty rows and columns

  1. #1
    Registered User
    Join Date
    03-27-2015
    Location
    Franklin Lakes, NJ
    MS-Off Ver
    Excel 2010
    Posts
    6

    VBA macro to delete all empty rows and columns

    Hello,

    I'm in need of a macro that will delete all the empty lines and columns within the spreadsheet. I need all empty lines after (and including) line 17 and all empty columns after (and including) Column V. I want to be able to add this to an existing macro.

    edit: Also, the deleting would have to be done before anything else withing the existing macro.

    The manual way I would do this would be to select the first empty line after the data (Ctrl+Shift+arrow key down), right click the spreadsheet and click delete. Same process for the columns. Then I would run the macro below


    Thank you
    Last edited by specialist1; 04-09-2015 at 02:06 PM. Reason: meant to write columns instead of rows

  2. #2
    Registered User
    Join Date
    03-27-2015
    Location
    Franklin Lakes, NJ
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro to delete all empty rows and columns

    Here is the macro I'm currently working with, just need the above concept added to the beginning

    Please Login or Register  to view this content.
    Last edited by specialist1; 04-09-2015 at 02:01 PM.

  3. #3
    Registered User
    Join Date
    03-27-2015
    Location
    Franklin Lakes, NJ
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: VBA macro to delete all empty rows and columns

    Essentially there are no blank rows/columns within the data. The blank rows/columns are all outside the data range. I need them deleted because our SAP system still recognizes them as lines. Thousands and thousands of lines being processed for no reason.

    This is the recorded macro from how I delete the rows manually.
    Please Login or Register  to view this content.
    Does anyone have any ideas how to have excel only delete the empty ones?

  4. #4
    Registered User
    Join Date
    03-27-2015
    Location
    Franklin Lakes, NJ
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: VBA macro to delete all empty rows and columns

    ****ISSUE SOLVED

    -admin please close the thread

+ 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. Delete Empty Rows and empty columns from the word table
    By mvneema in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2014, 10:51 AM
  2. [SOLVED] Delete rows when two columns are empty
    By Musoguy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-29-2013, 09:00 AM
  3. how to delete empty rows or columns only
    By tallercheetah in forum Excel General
    Replies: 3
    Last Post: 02-02-2012, 10:44 AM
  4. Find empty columns, rows and delete
    By ebe in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2010, 10:00 AM
  5. Delete rows with empty cells in columns B&C
    By Richard in forum Excel General
    Replies: 3
    Last Post: 03-17-2006, 08:20 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