Results 1 to 4 of 4

Thread: Explain App.Index(Rng, Rws(), Clms()) (multicolumn Combobox with Index.application)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Feb 2022
    Posts
    11
    Rep Power
    0

    Question Explain App.Index(Rng, Rws(), Clms()) (multicolumn Combobox with Index.application)

    Who can help me, I have the following code that I found somewhere that I don't remember:

    Code:
    Private Sub UserForm_Initialize()
    
       Dim rng As Range
    
       Set rng = Range("B4:D8")
    
       With ComboBox1
          .ColumnCount = 2
          .ColumnWidths = "50;50"
          ' load 1st, 2nd columns of range into combobox
          .List = Application.Index(rng, Evaluate("ROW(1:" & rng.Rows.Count & ")"), Array(1, 3))
       End With
    End Sub
    In "sheet1" I have three columns of data in the range from B4 to D8 (the headers in row 3). In a combobox the data of columns B and D appears.This is a multicolumn combobox with non-continuous columns (that are not next to each other). It works perfectly and is adapted to what I wanted. Unfortunately I don't understand how the line
    ".List = Application.Index(rng, Evaluate("ROW(1:" & rng.Rows.Count & ")"), Array(1, 3))"
    works and I can't stay So.

    I know that we are making an output list from an input list and I understand that evaluate with row is returning the index of the rows that have data in the range, from the first row to the fifth, and that with array we determine the columns which will take the combobox (or so I thought I understood).
    But why can't we use an array to determine the rows as well?
    I tried to do it and it didn't work for me.

    If someone is kind enough to tell me what data is returning evaluate (which is supposed to be used to occupy excel formulas in vba) with row, I would greatly appreciate it.

    I hope everything is understood. I'm using google translator.



    https://www.youtube.com/watch?v=yVgLmj0aojI&lc=UgwWg8x2WxLSxxGsUP14AaABAg. 9k3ShckGnhv9k89LsaigoO
    https://www.youtube.com/watch?v=yVgLmj0aojI&lc=UgxxxIaK1pY8nNvx6JF4AaABAg. 9k-vfnj3ivI9k8B2r_uRa2
    https://www.youtube.com/watch?v=yVgLmj0aojI&lc=UgxKFXBNd6Pwvcp4Bsd4AaABAg
    https://www.youtube.com/watch?v=yVgLmj0aojI&lc=Ugw9X6QS09LuZdZpBHJ4AaABAg


    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgwviLabd7r_3KpP6wh4AaABAg. 9h5lFRmix1R9h78GftO_iE
    https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgyG714V_k7odQMrTz14AaABAg. 9h740K6COOA9h77HSGDH4A
    https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgyG714V_k7odQMrTz14AaABAg. 9h740K6COOA9h76fafzcEJ
    https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgyG714V_k7odQMrTz14AaABAg. 9h740K6COOA9h759YIjlaG
    https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgyG714V_k7odQMrTz14AaABAg. 9h740K6COOA9h74pjGcbEq
    https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgyG714V_k7odQMrTz14AaABAg
    https://www.youtube.com/watch?v=2oT4qrHmDMY&lc=UgzJJUDVv2Mb6YGkPYh4AaABAg. 9h5uPRbWIZl9h7165DZdjg
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 07-10-2023 at 07:33 PM.

Similar Threads

  1. INDEX formula not working
    By SaburaZera in forum Excel Help
    Replies: 1
    Last Post: 02-03-2015, 08:29 AM
  2. HTML (Again!) arrOut()=Index(arrIn(),Rws(),Clms()
    By DocAElstein in forum Test Area
    Replies: 1
    Last Post: 08-23-2014, 02:27 AM
  3. Staffing Scheduling HELP Match/Index
    By mgelston in forum Excel Help
    Replies: 2
    Last Post: 06-20-2013, 01:09 AM
  4. VBA Trick of the Week :: Slicing an Array Without Loop - Application.Index
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 06-12-2013, 04:40 PM
  5. Index Sheets with Shapes and Hyperlink
    By TomyLee in forum Excel Help
    Replies: 9
    Last Post: 09-04-2012, 10:52 PM

Posting Permissions

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