Consulting

Results 1 to 4 of 4

Thread: Function in VBA (Excel) - Want a dynamic behavior depending on parameter

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi enggrahul78!
    Welcome to vbax forum.
    Please refer to the attachment.
    Function Correctanswer(MVAR1 As Long, MVAR2 As Long, MVAR3 As Long, MVAR4 As Long, Whattodo As String) As Long
    Dim s$
    s = Whattodo
    s = Replace(s, "MVAR1", MVAR1)
    s = Replace(s, "MVAR2", MVAR2)
    s = Replace(s, "MVAR3", MVAR3)
    s = Replace(s, "MVAR4", MVAR4)
    Correctanswer = Evaluate(s)
    End Function

    --Okami
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •