Split column to separate sheets based on text value

ziggyfo

New Member
Joined
Mar 24, 2021
Messages
24
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
Hi

Could someone possibly assist me, I am trying to achieve the following.

1. The information below is raw data that is pasted in and it will look exactly like the below.
2. I want the code to look down column A and split each race into its own sheet, rename the sheet and then remove the spaces between the times
3. The data is not static and under each race their may be various amounts of entries.

E1.JPG



eg, of how i want the information to look on each sheet is below.

E2.JPG

E3.JPG


Appreciate any assistance with this.

Cheers
 
Hi
Try
VBA Code:
Sub Test()
    Dim a As Variant
    Dim ar As Range
    Range("B2").Resize(Cells(Rows.Count, 1).End(xlUp).Row).Formula = _
    "=NOT(IF(OR(A2="""",ISNUMBER(FIND(""-"",A2)),ISNUMBER(FIND(""-"",A2))),""""))"
    For Each ar In Columns("b:b").SpecialCells(-4123, 16).Offset(-1, -1).Areas
        a = ar.Resize(ar.Rows.Count + 1)
        Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = ar(1)
        With Cells(1, 1).Resize(UBound(a))
            .Value = a
            .SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
        End With
    Next
    Sheets("Sheet1").Columns(2).ClearContents
End Sub
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,214,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top