![]() |
divide and conquer --- help!
I am trying to write a short macro for excel that will take the content
of a cell and then break each character up into a different cell. For example, in cell 1-A is "U1234A" I need my macro to break that into: 2-A = "U" , 2-B = "1" , 2-C = "2" , 2-D = "3" ...... etc. Can anyone give me a quick example code? My main problem is I don know how to program the macro to pull each character out of a selecte cell and break it up. I was thinking maybe put it into an array -- Message posted from http://www.ExcelForum.com |
divide and conquer --- help!
Sub BreakItUp()
Set rngSource = Range("a1") For z = 1 To Len(rngSource) rngSource.Offset(0, z) = Mid(rngSource, z, 1) Next z End Sub regards "anthrobro " wrote in message ... I am trying to write a short macro for excel that will take the contents of a cell and then break each character up into a different cell. For example, in cell 1-A is "U1234A" I need my macro to break that into: 2-A = "U" , 2-B = "1" , 2-C = "2" , 2-D = "3" ...... etc. Can anyone give me a quick example code? My main problem is I dont know how to program the macro to pull each character out of a selected cell and break it up. I was thinking maybe put it into an array? --- Message posted from http://www.ExcelForum.com/ |
divide and conquer --- help!
You can do it with worksheet functions
2A: =IF(LEN($A$1)=COLUMN(A2),MID($A$1,COLUMN(A2),1)," ") copy across -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "anthrobro " wrote in message ... I am trying to write a short macro for excel that will take the contents of a cell and then break each character up into a different cell. For example, in cell 1-A is "U1234A" I need my macro to break that into: 2-A = "U" , 2-B = "1" , 2-C = "2" , 2-D = "3" ...... etc. Can anyone give me a quick example code? My main problem is I dont know how to program the macro to pull each character out of a selected cell and break it up. I was thinking maybe put it into an array? --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 01:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com