Hi there,
I need some help in splitting the contents of a cell into multiple cells. For example,
From -> To
24678736 -> 24 46 67 78 87 36
4375 -> 43 37 75
the length of the targeted cell is not fix.
Is there a script that can do that?
Thanks.![]()
Hi there,
I need some help in splitting the contents of a cell into multiple cells. For example,
From -> To
24678736 -> 24 46 67 78 87 36
4375 -> 43 37 75
the length of the targeted cell is not fix.
Is there a script that can do that?
Thanks.![]()
Do you always want them in pairs of two? Do the values always have an even number of digits? If not, if the number of digits is uneven, how do you want to split?
1 23 45
or
12 34 5
??
Here's one approach:
Autofill to the right.![]()
Please Login or Register to view this content.
Cheers,
Last edited by ConneXionLost; 01-12-2010 at 04:08 AM.
Would you like to say thanks? Please click the: "Add Reputation" button, on the grey bar below the post.
Hi novodisc
Why not a UDF
PHP Code:
Function SplitInt(test)as string
Dim i!,e$
For i = 1 To Len(test) Step 2
e = e & " " & Mid(test, i, 2)
Next
SplitInt = e
End Function
Thanks a lot guys! All methods worked!
apperciate your help!
novodisc --- dont forget
To mark your thread solved do the following:
- Go to the first post
- Click edit
- Click Advance
- Just below the word "Title:" you will see a dropdown with the word No prefix.
- Change to Solve
- Click Save
novodisc,
Try:
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
Adding the Macro
1. Copy the below macro, by highlighting the macro code and pressing the keys CTRL + C
2. Open your workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Paste the code by pressing the keys CTRL + V
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
![]()
Please Login or Register to view this content.
Have a great day,
Stan
Windows 10, Excel 2007, on a PC.
If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks