SandsB
Well-known Member
- Joined
- Feb 13, 2007
- Messages
- 705
- Office Version
- 365
- Platform
- 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?
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?