Removing Dashes in Excel

R

Robert Cooper

In Excel 2007 I am regularly importing information about bonds. The
import includes dashes in the CUSIP number. Is there a way to import
into Excel 2007 eliminating the dashes? I will the copy and paste the
information into Bloomberg and Bloomberg does not recognize the
dashes. I know how to eliminate the dashes following the import. I
am trying to eliminate that step as we will be doing this daily.
 
D

Dave Peterson

Can you just import it with the dashes and then do an Edit|Replace to remove
those dashes (select the area first!)?
 
R

Robert Cooper

Can you just import it with the dashes and then do an Edit|Replace to remove
those dashes (select the area first!)?

It looks like that is going to be the answer. I was hoping to
eliminate a step because this is going to be a daily and sometimes
several times a day process. Thanks.
 
G

Gord Dibben

Try the macro recorder to import the data then remove the dashes.

Assign the macro to a button.

You can probably also add the copy and paste to Bloomberg steps in the same
macro.


Gord Dibben MS Excel MVP
 
B

Bob Flanagan

Try the macro recorder to import the data then remove the dashes.

Assign the macro to a button.

You can probably also add the copy and paste to Bloomberg steps in the same
macro.

Gord Dibben     MS Excel MVP




- Show quoted text -

You could use a statement like one of the following:

Columns("A").Replace What:=" - ", Replacement:=" ",
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False

Columns("A").Replace What:="-", Replacement:=" ", LookAt:=xlPart,
_
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False

Columns("A").Replace What:="-", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
ReplaceFormat:=False

depending on what replacement results you want.

Robert Flanagan
Add-ins.com LLC
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, fax 302-234-9859
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top