Split data insides a Cell

techissue2008

Board Regular
Joined
Jun 13, 2008
Messages
80
Hi
I use Excel 2002.

Spreadsheet 1 : Data source
Column One : Score
97:98
87:79

How can I get score data from column One of spreadsheet 1, Split the data 97:98 into 97 and 98 of spreadsheet 1, put them into 2 columns of spreadsheet 2

Column one
97
87
Column two
98
79

Sub splitdata()
Sheets("Sheet2").Cells.ClearContents
Sheets("Sheet2").Range("A").Value = Sheets("Sheet1").Range("A").Value
End Sub

It will show
0.041666667
0.001388889
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Welcome to the Board!

Try using data-->text to columns and use : as the delimiter.

Hope that helps.

Sorry I didn't see that you wanted to split them for another sheet.

Are they always 2 digits on both sides of the ":"?
 
Last edited:
Upvote 0
Hi
I use Excel 2002.

Spreadsheet 1 : Data source
Column One : Score
97:98
87:79

How can I get score data from column One of spreadsheet 1, Split the data 97:98 into 97 and 98 of spreadsheet 1, put them into 2 columns of spreadsheet 2

Column one
97
87
Column two
98
79

Sub splitdata()
Sheets("Sheet2").Cells.ClearContents
Sheets("Sheet2").Range("A").Value = Sheets("Sheet1").Range("A").Value
End Sub

It will show
0.041666667
0.001388889
Are you sure ?
try
Code:
Sub test()
Dim r As Range
With Sheets("Sheet1")
    With .Range("a1", .Range("a" & Rows.Count).End(xlUp))
        For Each r In .Cells
            Sheets("sheet2").Range(r.Address).Resize(,2).Value = Split(r.Text, ":")
        Next
    End With
End With
End Sub
 
Upvote 0
Stop Muliti/Cross poting
Code:
Sub test()
Sheets("Sheet7").Cells.ClearContents
Dim r As Range
With Sheets("Sheet1")
    With .Range("c1", .Range("c" & Rows.Count).End(xlUp))
        For Each r In .Cells
            Sheets("sheet7").Range(r.Offset(,2).Address).Value = Split(r.Text, ":0")(0)
            Sheets("sheet7").Range(r.Offset(,5).Address).Value = Split(r.Text, ":0")(1)
        Next
    End With
End With
End Sub
 
Upvote 0
techissue2008<SCRIPT type=text/javascript> Vbmenu_register("postmenu_1597237" said:
Hi Jindon

Sorry, I Will Just Post On This Forum.

May I Ask Why There Are (0) And (1) In The End Of
Code:
Sheets("sheet7").range(r.offset(,2).address).value = Split(r.text, ":0")(0)
Sheets("sheet7").range(r.offset(,5).address).value = Split(r.text, ":0")(1)
after Adding Them, There Is No Small Green Triangle Shown In The Cell.

Tommy
1) Get vbHelp for Split function and when you still don't understand it, post back

2) Green triangle will appear the cell when the data format/formula is different from the other cell in the column.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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