Copying part of a string to another cell

C

Chad

Hi All,

Is there an easy way to do this?
I want to copy the first 6 characters from [A1] to [K1], [A2]..[K2] all the
way to last row.

I am assuming I will have to use a loop and use the Left command. I was
just hoping for an easier way since it is the entire column.

Chad
 
J

JLGWhiz

this should work. Put it in the standard code module1


Sub cpyAtoK()
Dim c As Range
lstRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Set aRng = ActiveSheet.Range("A1:A" & lstRow)
For Each c In aRng
If Not c Is Nothing Then
c.Offset(0, 10) = Left(Trim(c.Value), 6)
End If
Next
End Sub
 
Top