Find and replace in code

C

Crazyhorse

These column headers can be 100 columns long with symbols in them. Each week
the row will change but the symbols will stay. How do I get rid of the
symbols and keep the words. Now the words will change weekly. Depending on
what fund they want to invest in but the symbols will stay. I know about find
and replace under ctrl H. I need this into code. I need this because the
symbols will not let me import this into a microsoft database. I was thinking
about a Case select. Any ideas?

I have a row of headers that looks like this for an small example
VKAC Senior Loan Fund!
Van Kampen Dynamic Credit Opportunities JL2X?
Asset_Name<
Issuer_Name.
Van Kampen Dynamic Credit Opportunities JL2Y^
VKAC Senior Income Trust*
VKAC Senior Loan Fund@
Zodiac Fund Morgan Stanley$


Thanks in advance
 
R

Rick Rothstein

Are we talking about removing only the symbols in the headers (that is, are
there symbols in the cells that also have to be removed)? Are the symbols
that have to be removed **always** at the end of the text? Are there always
only zero or one symbol (or can there be multiple symbols at the end of the
text)? If yes, which is it... zero, one or could it be both zero and one
mixed among the cells?
 
C

Crazyhorse

It is either zero or One. Never more then one. Yes it is always at the end of
the text.
Yes the symbols have to be removed so I can import the excel sheet into Ms
Access. I never know how many columns there will be so I will make it go to
256 columns.
 
R

Rick Rothstein

You didn't answer all my questions... Headers only or cells too? Generally,
code like this will work...

If YourText Like "*[!A-Za-z0-9]" Then
YourText = Left(YourText, Len(YourText) - 1)
End If
 

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