divide and conquer --- help!

A

anthrobro

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
 
O

Ocmulgee

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
 
B

Bob Phillips

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)
 
Top