beartooth91
Board Regular
- Joined
- Dec 15, 2024
- Messages
- 76
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Well, have been struggling with various combinations of Replace and Mid to delete the hyphens in a string while leaving the last one, if its present.
The data to search and replace is in one of the following forms and can be up to a maximum of 20 characters:
1-SYS-CC-0001 #Result should be 1SYSCC0001
1-SYS-CC-0002-A #Result should be 1SYSCC0002-A
1SYSCCTEXT-FCT # Result should be the same, unchanged
I believe what I'm looking for is to search the first 9-10 characters in the string and delete all hyphens within those first 9-10 characters. I just haven't been able to come up with the correct VBA to do it.
Any ideas? Thanks.
The data to search and replace is in one of the following forms and can be up to a maximum of 20 characters:
1-SYS-CC-0001 #Result should be 1SYSCC0001
1-SYS-CC-0002-A #Result should be 1SYSCC0002-A
1SYSCCTEXT-FCT # Result should be the same, unchanged
I believe what I'm looking for is to search the first 9-10 characters in the string and delete all hyphens within those first 9-10 characters. I just haven't been able to come up with the correct VBA to do it.
Any ideas? Thanks.