Removing multiple instances of a character

Jaryd

Board Regular
Joined
Apr 17, 2013
Messages
123
Hello,

I have been a casual read of these forums for a while. This is my first post.

I was hoping someone could help me. I would prefer VBA code, but a forumla would be fine too

I pull reports and some of the information that comes in I need to clean up so filters can be used. I am trying to find a faster way to do this. It is currently the only part of the clean up I do manually. The best pattern I found is all the text I want to keep is after the last "."

There can be 1 through 3 "."s in each cell. So I could not get Text to Columns to work.

Any help would be great. Thanks
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
what you need you want to remove all dot from each cell ?

or

can you post some data ( how data looks ) and what result you want ?
 
Upvote 0
I need to remove all data before the last dot / Keep all data after the last dot

Correction from my first post. It is only ever 1 or 2 dots.


123. Keep this text1
132. Task: 20. Keep this text2
123. Task: 123. Keep this text1
12. Keep This Text1234d12
12. Task 50. Keep This Text3
 
Upvote 0
That worked. Thank you so much. I did try finding this online first, but couldn't.

Now I can dissect that the formula to understand it. It is so much easier learning backwards like that.
 
Upvote 0
Hi Jaryd,

I'm pleased it worked for you and thanks for the feeback. :biggrin:

If you are searching online for an Excel solution, prefix your search with Excel, eg....

Excel find last occurence of character in cell

I hope that helps for future reference.

Ak
 
Upvote 0
If you are willing to use a formula, this is probably the simplest...

=TRIM(RIGHT(SUBSTITUTE(A1,".",REPT(" ",999)),999))

If, on the other hand, you want to physically change the values within the cells the text currently appears in, you do not need a formula nor VBA... select the column with your values, press CTRL+H to bring up the Replace dialog box, type *. (that is an asterisk followed by a dot) into the "Find what" field, leave the "Replace with" field empty, click the "Options>>" button and make sure the "Match entire cell contents" check box does not have a check mark in it, click the "Replace All" button

Finally, if you do want a VBA solution...
Code:
Columns("A").Replace "*.", "", xlPart
 
Upvote 0

Forum statistics

Threads
1,214,624
Messages
6,120,591
Members
448,973
Latest member
ksonnia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top