+ Reply to Thread
Results 1 to 8 of 8

Macro to remove the blank rows and detect header

  1. #1
    Registered User
    Join Date
    03-19-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    9

    Macro to remove the blank rows and detect header

    Dear All,

    I have uploaded a sample excel sheet wherein i would require to detect the header which is row 4 and remove all blank rows like row 5,8,9...etc.
    The purpose is to get the file into simple format which is row1 header followed by consolidated non blank rows.

    Hope i have made myself very clear and would anticipate your expert advices on the same.

    Thanks
    Ankur
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to remove the blank rows and detect header

    Press Alt-F11 to open the VBeditor
    Click on INSERT > MODULE
    Paste in this code:
    Please Login or Register  to view this content.
    Press Alt-F11 to close the editor
    Save your sheet.

    Press Alt-F8 and select the new macro to run it.
    Attached Files Attached Files
    Last edited by JBeaucaire; 03-19-2009 at 03:11 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to remove the blank rows and detect header

    Try
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    03-19-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to remove the blank rows and detect header

    thanks a lot.....u guys rock :-)

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to remove the blank rows and detect header

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

  6. #6
    Registered User
    Join Date
    03-19-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to remove the blank rows and detect header

    I have one more request before i close this thread, how can i make this macro run for all tabsheets available , in other words the macro should do the same operations for all the tab sheets in that particular workbook.

    Look forward for an early reply

    Ankur

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to remove the blank rows and detect header

    You haven't said which macro you are using, also is the data laid out exactly the same in each sheet? If it is
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-19-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Macro to remove the blank rows and detect header

    Sorry for not providing the information earlier, while running your code i got an error. I have also attached the screen shot for better understanding.Please lemme know the solution

    Thanks for your reply.

    Ankur
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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