+ Reply to Thread
Results 1 to 6 of 6

Condensing data in new sheet by removing blank rows

Hybrid View

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    Westminster, Colorado USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Condensing data in new sheet by removing blank rows

    Hello,

    I'm trying to condense my information by removing blank rows while keeping the order that the information is displayed.

    the sheet I'm pulling from has information in cells based on a Vlookup formula, however it reports it in the same row as on the sheet the array is on. I would like to take that info and condense it on another sheet fro faster reference.

    Example
    Column a has the numbers used for vlookup while column c has the result for the vlookup. there are empty spaces between results. I would like to take these empty spaces out and have just the returned data show on a new sheet for quick reference.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Condensing data in new sheet by removing blank rows

    Here is some code to delete all blank rows in a spreadsheet

    Sub DeleteBlankRows()
    'Deletes the entire row within the selection if _
    the ENTIRE row contains no data.
    
    Dim lastrow As Integer
    Dim MyRow As Integer
    Application.ScreenUpdating = False
    lastrow = ActiveSheet.UsedRange.Row - 1 + _
    ActiveSheet.UsedRange.Rows.Count
    For MyRow = lastrow To 1 Step -1
    If Application.CountA(Rows(MyRow)) = 0 Then Rows(MyRow).Delete
    Next MyRow
    Application.ScreenUpdating = True
    
    End Sub
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-10-2013
    Location
    Westminster, Colorado USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Condensing data in new sheet by removing blank rows

    Thank you for your input, However I really don't want to delete rows as the workbook i'm creating will change based on the data I input so i'm trying to just use simple formulas so that I can adjust them depending on the needs

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Condensing data in new sheet by removing blank rows

    I don't understand your follow up comment. In your original statement you stated

    I'm trying to condense my information by removing blank rows while keeping the order that the information is displayed.
    If you don't delete the row, what other choice is there for "removing" a blank row? What do you want to happen with the blank row?

    If you still have not solved this issue, suggest you upload a sample worksheet with current structure and what you want structure to look like after "removing" blank rows.

    Alan
    Last edited by jeffreybrown; 06-26-2013 at 09:20 PM.

  5. #5
    Registered User
    Join Date
    05-10-2013
    Location
    Westminster, Colorado USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Condensing data in new sheet by removing blank rows

    Conditional book 2 - Update.xlsxSorry for the confusion, attached is an updated doc showing (hopefully) how I would like to have the data look when finalized. It's not so much as removing or deleting rows but more of omitting them and moving the data to the first available "blank" cell in the column. I have the logic in my head on how it should work but getting the formulas to behave the same is a little tricky for me

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Condensing data in new sheet by removing blank rows

    Because you have formulas in each cell, there are no blanks and my vba would not work in that case. You may want to consider some method of sorting based upon the data returned or employing a helper column to assist in your sort.

    Alan

+ 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