+ Reply to Thread
Results 1 to 15 of 15

How do I remove blank lines in the first column.

  1. #1
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    How do I remove blank lines in the first column.

    I've attached the .xlsm file with the code but it doesn't seem to be working. Is their something I can't see in the first column and how can I tell? Is the syntax in error?

    I just want to run through my excel data file removing all blank first columns.

    Thanks!test.xlsm

  2. #2
    Forum Guru tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How do I remove blank lines in the first column.

    SWMagic,

    Ummm... the file you posted is completely blank already... ?
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,747

    Re: How do I remove blank lines in the first column.

    Yep, no data, no code, nothing.

  4. #4
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Re: How do I remove blank lines in the first column.

    OK, don't know...I'll try againtest2.xlsm

    The file is 8.98kb. as an excel test2.xlsm file

    Here's the macro:

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 07-27-2013 at 10:16 AM.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,747

    Re: How do I remove blank lines in the first column.

    Try:

    Please Login or Register  to view this content.

    Empty, I think, is a reserved word and probably isn't doing what you think it is. And I like to be sure which row to start at ... UsedRange is unpredictable.

    Regards, TMS

  6. #6
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How do I remove blank lines in the first column.

    Hi SWMagic

    Please insert Code Tags around your Code in Post #4 then try this
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  7. #7
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Re: How do I remove blank lines in the first column.

    Nope. This didn't do anything. that's surprising too. However, I only want to pick up the empty first column rows, because you'll see one header line on each "page" that also needs to go...and I thought focusing on the first column would work.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,747

    Re: How do I remove blank lines in the first column.

    Please add Code Tags to your code extract in your OP, as jaslake has requested, before we continue with this.

    Thanks, TMS

  9. #9
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Re: How do I remove blank lines in the first column.

    I simply don't know what Code Tags are in my code extract in my OP. Please explain as I can't find anything about that in a Google search

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Excel 2016
    Posts
    10,178

    Re: How do I remove blank lines in the first column.

    Hi SWMagic,

    Try...

    Administrative Note:
    • We would love to continue to help you with your query, but first, before we can proceed…
    • Please see Forum Rule #3 about the proper use of code tags and adjust accordingly...
    • Added for you this time, but please use them in the future…Thanks.
    HTH
    Regards, Jeff

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,114

    Re: How do I remove blank lines in the first column.

    will remove rows with empty cells in column A

    Please Login or Register  to view this content.
    If the cells contain spaces then you will need to loop and test for "" on trimmed cells

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  12. #12
    Registered User
    Join Date
    08-25-2005
    Posts
    37

    Re: How do I remove blank lines in the first column.

    I don't think they do contain spaces as I would see those at the formula box at the top right? In other words, a space doesn't hide there in another way right?

  13. #13
    Forum Guru jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How do I remove blank lines in the first column.

    Hi SWMagic

    The attached file contains this Code and shows Before and After worksheets. What is it that's not working for you? Please explain...
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,114

    Re: How do I remove blank lines in the first column.

    In the example file, test2.xlsm, you posted

    Length of A1 is 3 contains Mr.
    Length of A2 is 3 contains Mr.
    Length of A3 is 1 contains space
    Length of A4 is 0 is empty
    Length of A5 is 3 contains Mr.
    Length of A6 is 3 contains Mr.

    Therefore row 3 will remain, but perhaps you want that to remain.

  15. #15
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How do I remove blank lines in the first column.

    Quote Originally Posted by SWMagic View Post
    I don't think they do contain spaces as I would see those at the formula box at the top right? In other words, a space doesn't hide there in another way right?
    Row 3 has a space in it.

    Maybe:

    Please Login or Register  to view this content.

+ 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. Create List and remove blank Lines
    By jamjam200 in forum Excel General
    Replies: 0
    Last Post: 01-22-2013, 12:30 PM
  2. Remove Blank Lines
    By Robotacha2010 in forum Excel General
    Replies: 5
    Last Post: 08-16-2010, 11:59 AM
  3. Remove lines without a value in column M?
    By Claude-Smith in forum Excel General
    Replies: 4
    Last Post: 09-05-2007, 09:51 AM
  4. Remove Blank Lines
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2005, 11:00 AM
  5. remove blank lines from an entire spreadsheet
    By mdeanda in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-21-2005, 09:06 AM

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