View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
ShaneDevenshire ShaneDevenshire is offline
external usenet poster
 
Posts: 2,344
Default Strip first 5 characters from a cell.

Hi,

Here is Don's macro modified and very fast:

Sub Super()
Range([L1], [L65536].End(xlUp)).TextToColumns _
Destination:=[L1], DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 9), Array(5, 1))
End Sub

And if you don't insert the line continuation character this is a one line
macro.

--
Thanks,
Shane Devenshire


"Don Guillett" wrote:

One way using the macro recorder to use datatext to columns.
Sub Macro7()
'
' Macro7 Macro
' Macro recorded 10/19/2008 by Donald B. Guillett
'

'
Range("B1:B2").Select
Selection.TextToColumns Destination:=Range("B1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(5, 1)), TrailingMinusNumbers:=True

End Sub
cleaned up
Range("B1:B2").TextToColumns Destination:=Range("B1"), _
DataType:=xlFixedWidth,FieldInfo:=Array(Array(0, 1), Array(5, 1))


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mahnian" wrote in message
...
I need to remove the first 5 characters from every cell in column L and
replace the new string back into the originating cell.

Example:
337;#Error code
127;#Different Error Code

Would become--

Error Code
Different Error Code

So on and so forth.

Thank you in advance..
--Mahnian