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

asked on

Excel VBA: keep & remove text based on character & add-in

Hello experts,

Following the question: Question 29176080
which allows me to keep and remove text based on character. I need some help to add to my add-in to be able to swiftly use the procedure on a daily basis.

-Reference procedure to be added in the add-in located at: EE29176080.xlsm
-Reference add-in LD-add-in.xlsm

It should be added at: Keep_Remove_Text_Based_On_Char
User generated image
Located at:
User generated image
If you have questions, please contact me.

Thank you in advance for your help.
LD-add-in.xlsm
EE29176080.xlsm
Avatar of Bill Prew
Bill Prew

Give this a try Luis.

LD-add-in.xlsm


»bp
Avatar of Luis Diaz

ASKER

Hi Bill,

Thank you very much for this.
I tested but I am having a strange issue (complicated to identify). When I launch the procedure from my LD-add-in.xlsm the procedure works perfectly.

When I save the xlsm file as xlam file in order to use it across multiple files (as I do as always). I have the following error message:

User generated image
This is not the case for a similar procedure which use userform. User generated imageProbably if we take as a reference variable definitions of the one that works, we are able to solve the problem.


What do you think?

Regards,
Luis.
I think I see the problem, give this a try.

LD-add-in.xlsm


»bp
Thank you Bill.

Good news, I don't have the same error.
Bad news, I have another error but the good news of the bad news is that I know where it is located:

I proceed like this:User generated imageAnd I have:User generated image
Sorry, thought that was changed, should be:

    Select Case True
        Case optKeepBefore
            Keep_Remove_Text_Based_On_Char_Logic 1, txtColumns.Text, txtDelim, chkBackup, ActiveSheet
        Case optKeepAfter
            Keep_Remove_Text_Based_On_Char_Logic 2, txtColumns.Text, txtDelim, chkBackup, ActiveSheet
        Case Else
            MsgBox "Please select at least one option", vbOKOnly + vbInformation, "No Action Chosen"
            Exit Sub
    End Select

Open in new window


LD-add-in.xlsm


»bp
Thank you Bill, I will test it and let you know.
Hi Bill,

I tested but now I am having the following message:
User generated image
Luis,

That routine is in the "g1aStringsFormulas" module, it sounds like you might have missed some code merging in there?

User generated image

»bp
Hi Bill,
I just took the add-in that you posted at:#a43050781, remove the previous xlam file and save the xlsm as xlam to use it across workbooks as I do always.

The routine is there:
User generated image
Private Sub declaration is not causing the problem?
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
Thank you Bill.