Results 1 to 4 of 4

Thread: Move dataset to new column when descriptor appears
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Sep 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Move dataset to new column when descriptor appears

    Hi,

    I'm trying to move a dataset into a new set of columns every time a descriptor appears.

    More specifically, if you look at linked images, I would like to move the corresponding dataset to new columns every time the word "particle" appears.

    Linked image #1 : https://wehieduau-my.sharepoint.com/...OXXdA?e=sDq7HR

    Linked image #2 : https://wehieduau-my.sharepoint.com/...w6eGQ?e=KBkAJu

    Any help with this would be greatly appreciated.

    Thanks,

    Andre

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Move dataset to new column when descriptor appears

    Hi & welcome to MrExcel.
    How about
    Code:
    Sub SamsonALS()
       Dim Ar As Areas
       Dim i As Long
       
       Set Ar = Range("A:A").SpecialCells(xlConstants).Areas
       For i = 2 To Ar.Count
          Ar(i).Resize(, (i - 1) * 4).Insert xlToRight
       Next i
    End Sub
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    New Member
    Join Date
    Sep 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Move dataset to new column when descriptor appears

    Quote Originally Posted by Fluff View Post
    Hi & welcome to MrExcel.
    How about
    Code:
    Sub SamsonALS()
       Dim Ar As Areas
       Dim i As Long
       
       Set Ar = Range("A:A").SpecialCells(xlConstants).Areas
       For i = 2 To Ar.Count
          Ar(i).Resize(, (i - 1) * 4).Insert xlToRight
       Next i
    End Sub
    Hi Fluff,

    Thanks for your reply. Your code worked perfectly. Much appreciated!

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: Move dataset to new column when descriptor appears

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •