+ Reply to Thread
Results 1 to 5 of 5

Remove spaces in data set

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Remove spaces in data set

    Can someone help me write a simple macro that removes 5 blank spaces between each example on the Raw tab in my workbook. The Removed Spaces tab shows how the data should look after the spaces are removed. Any help with this would be great. Thanks
    Attached Files Attached Files
    Last edited by rhudgins; 10-12-2010 at 05:58 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Remove spaces in data set

    Here's a quick example of how to do this. I moved your Criteria label to column A and centered it across selection. This way it can be used in the code and it also looks more centered on your sheet.

    One thing I'd like to point out:
    - Are you sure you are going to want to delete 5 rows every time? If not, we could come up with a way to leave only two "spacer" rows between one Criteria and the next.
    Attached Files Attached Files
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Remove spaces in data set

    Thanks. Yes ,I would like to delete 5 rows everytime.

    Eventually I will have hundreds of these examples on the spreadsheet so moving the Criteria label to column A for all of them will not make sense. Is there a way around this?

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Remove spaces in data set

    Yes, the code can be changed to:

    Please Login or Register  to view this content.

    However, I don't see what the number of Criteria has to do with them being in Column A instead of Column E like you have them now. Did you realize that I was talking about the actual label that says "Criteria"?

  5. #5
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Remove spaces in data set

    This is perfect! Thanks for your help

+ 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