Luis Diaz
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Bill,
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.
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.
ASKER
Thank you very much Bill!
I tested and it works! Already added to my Add-in file.
Thank you again!
Regards,
Luis.
I tested and it works! Already added to my Add-in file.
Thank you again!
Regards,
Luis.
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