+ Reply to Thread
Results 1 to 18 of 18

Using WorksheetFunction.Index (Error)

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Using WorksheetFunction.Index (Error)

    Hi.
    could someone help me fix this code so I put it to work?

    Compile error:
    Syntax Error
    Please Login or Register  to view this content.
    thank you
    Last edited by marreco; 09-08-2012 at 02:57 PM.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using WorksheetFunction.Index (Erro)

    We know everything except what you're trying to do ...
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Hi.
    I do intend to work returning the data in a worksheet named 'FIN'

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Using WorksheetFunction.Index (Erro)

    .Range("A2:A" & LastRow).Application.WorksheetFunction.Index(BD!A2:B2000,MATCH(FIN!B2,BD!B2:B2000,0),1)

    Maybe it should be .Range("A2:A" & lastrow) = "=index(BD!A2:B2000,worksheetfunction.Match(FIN!B2,BD!B2:B2000,0))"

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Hi..

    is not it!!

    #Name?

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Hi.

    Any suggestion?

    Thank you!!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using WorksheetFunction.Index (Erro)

    Yes, same as before: I suggest you explain in words, not code, what you're trying to do.

  8. #8
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Hi shg

    How will a database, then I will have many rows with formula.
    this leaves my spreadsheet quite heavy and work hard.
    to avoid this, I need the VBA do the calculation and not the Excel.Eu need to have the results in cells without becoming formulas.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using WorksheetFunction.Index (Erro)

    Do *what* calculation?

  10. #10
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    this would be the calculation that I need
    Application.WorksheetFunction.Index(BD!A2:B2000,MATCH(FIN!B2,BD!B2:B2000,0),1)

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using WorksheetFunction.Index (Erro)

    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Hi.
    correct it worked, now I need to drag it down according to the data from column 'B'

    Thank you!!

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using WorksheetFunction.Index (Erro)

    I don't know what that means. The formula is in col A.

  14. #14
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Hi.
    your code is doing what I need, but just need to drag the formula down and only later transformed into values​​.

  15. #15
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using WorksheetFunction.Index (Erro)

    The code should enter the formula in all the cells down to the bottom of column B as it is.

  16. #16
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Your code is fine, I just need to add a detail, if possible.

    the code would put the formula in column 'A' (this is already done), then drag down (this does NOT done), then trasformaria in values ​​(this is already done).

    Can you help me?

    thank you!
    Last edited by marreco; 09-08-2012 at 02:56 PM.

  17. #17
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using WorksheetFunction.Index (Erro)

    Ah.

    Please Login or Register  to view this content.

  18. #18
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Using WorksheetFunction.Index (Erro)

    Hi.

    was wonderful, I'm very happy for helping me!
    thank you very much!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1