• Set Property with user input w/o Case or ElseIf

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Set Property with user input w/o Case or ElseIf

    Author
    Topic
    #355480

    My macro gives gives the user the option to export a Excel 97 worksheet range according to his/her needs using these properties:
    Cells(r,c).Value
    Cells(r,c).Text
    Cells(r,c).Formula

    Q: How can I make the VBA/Excel 97 interpreter to accept something like this:

    DoItMyWay=Inputbox(“How do you want it ? Value, Text, Formula ?”,”Value”)
    .
    .
    XYZ=Cells(r,c).DoItMyWay

    I could do this using Case or ElseIf, but I wonder whether I can do this directly with a one liner.

    Viewing 0 reply threads
    Author
    Replies
    • #524540

      calacuccia, thanks, but this really would be overkill. I am only trying to reduce the number of similar calls. I thought this should be easily possible, VBA being an interpreted language.

    Viewing 0 reply threads
    Reply To: Set Property with user input w/o Case or ElseIf

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: