Consulting

Results 1 to 5 of 5

Thread: Solved: Evaluate("INDEX vs Application.Index

  1. #1
    VBAX Mentor
    Joined
    Dec 2009
    Posts
    416
    Location

    Solved: Evaluate("INDEX vs Application.Index

    Hello

    I am trying to transform this line:

    [vba]
    For Each dPart In Evaluate("INDEX(" & Me.ComboBox1.Value & ", , 1)")
    [/vba]
    to replace Evaluate("INDEX(" with Application.WorksheetFunction.Index( Me.Combobox1, ,1) 'not working

    can someone help me to put this in a correct way
    thank you

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    You need:
    [vba]Application.WorksheetFunction.Index(Sheets("some sheet").Range(Me.Combobox1), 0,1) [/vba]
    Be as you wish to seem

  3. #3
    VBAX Mentor
    Joined
    Dec 2009
    Posts
    416
    Location
    but combobox1 has a collection of dynamic name of ranges (rang1, rang2, etc). so normally you do not need to add the Sheets"name".range etc ... or I am wrong?

  4. #4
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    It depends where your code is located. You may be able to simply use:
    [vba]Application.WorksheetFunction.Index(Application.Range(Me.Combobox1), 0,1) [/vba]
    Be as you wish to seem

  5. #5
    VBAX Mentor
    Joined
    Dec 2009
    Posts
    416
    Location
    yes, you are correct!It is working thank you

Posting Permissions

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