+ Reply to Thread
Results 1 to 8 of 8

Remove Blank Rows from all Sheets Macro Help!

  1. #1
    Registered User
    Join Date
    10-27-2023
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    6

    Remove Blank Rows from all Sheets Macro Help!

    Hi all,

    First of all hello, I'm new to this forum and just about as new to VBAs and Macros! I'm hoping I can get some advice...

    I have a workbook which contains 48 sheets. these 48 sheets have 2 lists of data varying length, that formulate from a master workbook. Each week the length of the lists change depending on the info input into the master. I then have a macro that saves each of these sheets into individual pdfs.

    I have a code that works like a dream to remove all the blank rows on my first sheet- what I would love is if this could run through all of the 48 sheets, not just the first!

    How do I add to my code "all sheets" rather than just the sheet in on?

    I've spent the last 2 days Googling but I'm hitting a wall!


    For info, the first list starts at C7 and is 9 columns long. I give about 100 rows to both lists just in case (the second starts beneath the first at about C107) and the "blanks" have forumla in but appear blank, my below code doesn't seem to mind this

    My code is:

    Please Login or Register  to view this content.

    I've attached an example workbook that has the same layout as what I'm after!

    Any help here?
    TIA legends!
    Last edited by GarnesGambit; 10-27-2023 at 10:30 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Remove Blank Rows from all Sheets Macro Help!

    I have added code tags for you, as you are new. Please review the forum guidelines.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-27-2023
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    6

    Re: Remove Blank Rows from all Sheets Macro Help!

    Thank you Ali! Much appreciated

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Remove Blank Rows from all Sheets Macro Help!

    Try

    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    10-27-2023
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    6

    Re: Remove Blank Rows from all Sheets Macro Help!

    Hi, thanks so much for your time replying- unfortunately that doesn't work in this instance. It jus seems to remove a few random rows?

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Remove Blank Rows from all Sheets Macro Help!

    Post a sample workbook.

    It removes any rows where column C cell is blank: not what you want?

  7. #7
    Registered User
    Join Date
    10-27-2023
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    6

    Re: Remove Blank Rows from all Sheets Macro Help!

    Hi JohnTopley - I have an example book attached to my original post, can you see this?

    Yes, I want all cells where column C is blank removed, across all sheets. But when I ran your macro there it only deleted a few rows across the sheets. Perhaps I'm doing something wrong....perhaps it's my Excel glitching?

    Let me know if you have any insight after viewing the Workbook?

    Thanks again for time on this.

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Remove Blank Rows from all Sheets Macro Help!

    I don't know if this is the case in your workbook but a common problem is that cells look to be empty but have a non printable character in it (space is one of the possibilities)

    If you run this on each sheet it should show which ranges are empty.
    Please Login or Register  to view this content.
    Or you can run this to see how many cells in that Range are not empty.
    Please Login or Register  to view this content.
    Last edited by jolivanes; 10-27-2023 at 02:56 PM.
    Experience trumps academics every day of the week and twice on Sunday.

+ 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. [SOLVED] multiple sheets into master sheet with auto filter to remove blank rows
    By hford323 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2023, 01:20 PM
  2. [SOLVED] Remove blank rows in pivot WITH MACRO
    By habib100 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-20-2019, 06:10 AM
  3. [SOLVED] Update VBA code - remove blank rows in newly created sheets
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2016, 03:17 PM
  4. Macro to remove extra blank rows
    By alexduy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2013, 01:20 PM
  5. [Macro] Remove blank rows (apart from 1 to separate datasets)
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2011, 05:41 PM
  6. Macro to remove the blank rows and detect header
    By coolanks1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-20-2009, 03:40 AM
  7. Need macro to remove blank rows
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-21-2006, 08:25 AM

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