Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

Excel VBA: retain values on a column based on string with 2 modes

Hello experts,

Following the questions resolved at:
I was wondering if we can cover the new requirement:
Have two modes modulated by an inputbox which allows me to retain prefix from left to right as is and another mode to retain prefix from right to left.

I attached the current procedure and the expected result for mode 1 and 2.

Thank you for your help.
Prefix_String.xlsm
Avatar of Bill Prew
Bill Prew

I assume this is in relation to this prior question?


Can you explain a bit more about the new "right to left" option?  In the case of your example file that you attached, what string would you have entered to produce the results you want in column C?  Would it still be "test", and therefore you want to take everything from the LEFT up to and including the string entered in the prompt?  Or something else?


»bp
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luis Diaz

ASKER

Bill,

Would it still be "test", and therefore you want to take everything from the LEFT up to and including the string entered in the prompt?

Yes the string reported was test. The idea is to have two modes: 1 take the string reported from right to left and 2 take the string reported from left to right including the string reported.

Just one question prior to test. Should I report exactly the string in upper or lower case on the basis of string in the cell.
Example
I have in cell A2 123Id456 in order to get 123Id with mode 1 or Id456 with mode 2 should I report Id in the inputbox or can I report ID or id?

Thank you for your help.
Your starting code that you posted ignored case, so that is true of the new change as well.
Thank you very much Bill!
I tested and it works! Already added to my Add-in file.

Thank you again!

Regards,
Luis.