How do you remove asterisks from text in excel?

I am working with a table that has asterisks within a cell used as text within a specific range and they need to be removed.

What would the VBA code be to accomplish this within an existing macro?
LVL 2
bearblackGlobal Program ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Harry LeeCommented:
I don't think you need to use VBA.

Select the range of cells you want to remove the * from,

Use Replace feature of Excel, in Find What, type in ~*, and in the Replace With, type in whatever you want to replace it with. A space maybe what you want.

The ~ will instruct Excel to search for * instead of treating the * as wildcard character.
0
bearblackGlobal Program ManagerAuthor Commented:
I do need to put this into the macro need to work with the data afterward.
0
Martin LissOlder than dirtCommented:
Here's a macro that you can use. It looks at all the cells in the active sheet but you can narrow that down if you like.


Sub RemoveAsterisk()
Dim c As Range

For Each c In ActiveSheet.UsedRange.Cells
    c = Replace(c.Value, "*", "")
Next
End Sub

Open in new window

0
Rory ArchibaldCommented:
You can also use the range.replace method:
ActiveSheet.UsedRange.Replace "~*", ""

Open in new window

rather than looping.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bearblackGlobal Program ManagerAuthor Commented:
Thanks to both of you for your help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.