Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Deleting the leading character in a series of cells

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting the leading character in a series of cells

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...



--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Deleting the leading character in a series of cells

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


--
Don Guillett
SalesAid Software

"Alex" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting a cell from series , why the series gets disturbed? Jyoti Excel Worksheet Functions 1 March 24th 08 11:32 AM
add leading character Satnam Randhawa[_2_] Excel Discussion (Misc queries) 6 January 4th 08 01:43 PM
Need to add character before leading zero in a field Melin Excel Discussion (Misc queries) 7 December 8th 07 05:21 AM
How do I force a leading zero character eg 07817 m800afc Excel Discussion (Misc queries) 3 March 22nd 06 07:27 PM
Dropping leading zeros in character fields. Ron K Excel Programming 2 September 11th 03 07:41 AM


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"