Delete all text after 14th ^

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
705
Office Version
  1. 365
Platform
  1. Windows
Let's say you have a file with a column of text. Within that text are some ^ symbols. Something like this:

Here's^my^sample^text.^It^rambles^on^like^this^for^a^while^with^these^stupid^symbols^in^there^and^a^macro^does^a^Text to Columns^to^put^the^data^where^it^needs^to^go.

I need to get rid of all text after the 14th ^ leaving me with (in the example above) nothing but:

Here's^my^sample^text.^It^rambles^on^like^this^for^a^while^with^these^

The data file has several hundred rows and the text between the ^s will be different in all of them. Almost all of the cells in question will have 14 ^s. Some of the cells in this column will be (and should be) completely blank. Bad typing by the person entering data could mean that some of these cells have more or fewer ^s. If fewer - leave as is. If more, delete everything after the 14th ^.

How can I do that in VBA?
 
Not sure which one your referring too, but glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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