Call a VBA function by string value

9,331

Try using Application.Run to call it.

Application.Run function_name

Share:
9,331

Related videos on Youtube

David Gard
Author by

David Gard

Updated on September 18, 2022

Comments

  • David Gard
    David Gard almost 2 years

    In VBA, is there a way to call a function by string value?

    For example -

    Dim function_name, value1, value2 as String
    
    value1 = "test"
    value2 = "Function"
    function_name = value1 & value2 ' So function name = 'testFunction'
    
    call function_name ' But this calls a function called 'function_name', where as I require a funtion called 'testFunction'
    
  • David Gard
    David Gard over 11 years
    Run, that's the bad boy. Thanks for the help.
  • DrColossos
    DrColossos over 10 years