Luis Diaz
asked on
Excel VBA: keep everything a character & string
Hello experts,
The following attached file contains a reference userform which allows me to add numbers or letters on columns.
Ref EE comment available at: #a43048196
I would like to take it as a reference to cover the following need:
Dual modulation:
1.Keep everything before specific character.
2.Keep everything after the first comma
Example:
-Input: 58dcRoc / xnk Nc jco
-Character: /
-Expected result 1: 58dcRoc
-Expected result 2: xnk Nc jco
I think that the easiest way to manage this need is through a single character, however I would like to go beyond and I was wondering if there is a way to report specific string instead of a single character.
Example
-Input: 58dcRoc / xnk Nc jco
-String: xn
-Expected result 1: 58dcRoc /
-Expected result 2: k Nc jco
Expected result 2: xnk Nc jco
If you have questions, please contact me.
ExtractStringAfterCertainChar.xlsm
The following attached file contains a reference userform which allows me to add numbers or letters on columns.
Ref EE comment available at: #a43048196
I would like to take it as a reference to cover the following need:
Dual modulation:
1.Keep everything before specific character.
2.Keep everything after the first comma
Example:
-Input: 58dcRoc / xnk Nc jco
-Character: /
-Expected result 1: 58dcRoc
-Expected result 2: xnk Nc jco
I think that the easiest way to manage this need is through a single character, however I would like to go beyond and I was wondering if there is a way to report specific string instead of a single character.
Example
-Input: 58dcRoc / xnk Nc jco
-String: xn
-Expected result 1: 58dcRoc /
-Expected result 2: k Nc jco
Expected result 2: xnk Nc jco
If you have questions, please contact me.
ExtractStringAfterCertainChar.xlsm
ASKER
Thank you very much Bill, I tested and it works!
I realized that I need to keep initial information.
Possible to add another option:
-Add a backup option in the form:
Yes/No (Backup active sheet?). Yes: backup initial sheet with the following name YYYYMMDDHHMMSS_Sheet_Name.
If the option is complicated to implement always backup sheet with the following name: YYYYMMDDHHMMSS_Sheet_Name.
Thank you again.
I realized that I need to keep initial information.
Possible to add another option:
-Add a backup option in the form:
Yes/No (Backup active sheet?). Yes: backup initial sheet with the following name YYYYMMDDHHMMSS_Sheet_Name.
Format(Now, "YYYYMMDDMMSS") & ActiveSheet.Name
If the option is complicated to implement always backup sheet with the following name: YYYYMMDDHHMMSS_Sheet_Name.
Thank you again.
Okay, added that to this version. Keep in mind sheet names can only be 30 characters long, so after adding the date/time to the left I had to truncate the rest to 30 chars.
EE29176080.xlsm
»bp
EE29176080.xlsm
»bp
ASKER
Great Bill! I will test it and keep you informed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great Bill, I will continue the tests tomorrow and let you know.
ASKER
Bill,
I tested both modes and backup option and it works!
Thank you again!
I tested both modes and backup option and it works!
Thank you again!
Welcome Luis, stay safe.
»bp
»bp
ASKER
Thank you Bill, you too.
EE29176080.xlsm
»bp