-2

I want to run this function

I opened the developer tab in excel, no clue what to do now. I tried creating a "macro button", and then paste the function code in the macro script, but if I press play I get a error related to Private Sub CommandButton1_Click()

and if i try to save the macro, I get this dialog box:

enter image description here

4
  • 1
    The error dialog tells you exactly what's going on, and what you need to do. So where are you getting stuck exactly? Commented Mar 2, 2016 at 18:09
  • I clicked yes, it didn't chang anything. I even don't care about saving this, I just want to run it, no clue how to do that.
    – rockyraw
    Commented Mar 2, 2016 at 18:11
  • Like the error says, you need to use a macro-enabled workbook (.XLSM) for macros to work... Beyond that "I get a error related to Private Sub CommandButton1_Click()" doesn't tell us enough, we need to know exactly what the error said. Commented Mar 2, 2016 at 18:20
  • The SE question you refer to has specific instructions how to call this function. I don't believe simply running it will work. It is looking for variables which are given when it is called.
    – CharlieRB
    Commented Mar 2, 2016 at 18:22

1 Answer 1

-1

Saving Excel files with Functions / macros:

In your message prompt shown in your question, Click No - Excel will take you to the Save As dialog. Enter the file name and remember to select the file type as Excel Macro-Enabled Workbook and click Save.

Running the function:

You have to select any cell (in any of the worksheet within the same file) and type the name of the function =RegexExtract() ( with any of the applicable arguments) to see the function work.

Not the answer you're looking for? Browse other questions tagged .