Deleting the leading character in a series of cells

A

Alex

Is there a way to program a deletion in a series of cells?

I have rows of data that start with a underscore and I want
to find an efficient way to delete them. Any suggestions?

For example:
A
_40295
_40296
_9000143
_60000

I thought I could use a macro, but it only takes the
value "40295" and copies it in every cell.

Thanks for your help.
Alex
 
K

kkknie

You could use the Replace function (ctrl-h) and put the underscore i
the find box and nothing in the replace box. Then just replace all.

Another option to strip the first character using:

=Right(A1,Len(A1)-1)

in a new column. Then copy the column and paste special to clear th
formulas.

I'd also give a macro example, but that would be overkill...
 
D

Don Guillett

If you only have the ONE _ underscore, the fastest would be with this
recorded macro.
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 6/24/2004 by Don Guillett
'

'
Range("E1:E4").Select
Selection.Replace What:="_", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
 
Top