+ Reply to Thread
Results 1 to 4 of 4

Macro to find a value and insert blank space after it

  1. #1
    Registered User
    Join Date
    07-15-2014
    Location
    Ireland
    MS-Off Ver
    2019
    Posts
    47

    Macro to find a value and insert blank space after it

    Hi all,

    I have a load of data. This data for a many many months and many many different items numbers. The item numbers do not appear the same amount of time, each time. Some appear only once while others might appear 20 times. I have the data ordered to the item numbers are all from smallest to largest. What I would like to do is use a macro to paste the item number, find the last time item 1 shows, insert a blank line after it and then group the items and them repeat the process for the rest of the items.

    I am wondering is this possible to do?

    Thank you in advance,

    Stephen

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to find a value and insert blank space after it

    Why not just sort?

    You could make it more complex, with something like:
    Please Login or Register  to view this content.
    But I reckon, if I've understood your requirement, that simply sorting would do the job.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    07-15-2014
    Location
    Ireland
    MS-Off Ver
    2019
    Posts
    47

    Re: Macro to find a value and insert blank space after it

    I have attached a copy of an example.

    the first sheet shows what I have while the second sheet shows what I want.
    Attached Files Attached Files

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to find a value and insert blank space after it

    This does exactly what you want - transforms Sheet1 into the structure shown in Sheet2:
    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. [SOLVED] Use COUNTIF() to find the number of cells not equal to a blank space
    By BNCOXUK in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-21-2012, 06:39 AM
  2. Macro to find missing data and insert blank row
    By williampdx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2011, 09:37 PM
  3. macro to find first blank cell in rows and insert text
    By jlm13 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-21-2010, 06:27 PM
  4. Find the nearest blank space to the center of text
    By Hitch75 in forum Excel General
    Replies: 29
    Last Post: 09-30-2009, 04:09 PM
  5. Replies: 5
    Last Post: 03-19-2006, 12:45 PM

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