Consulting

Results 1 to 3 of 3

Thread: Ctrl Shift Enter on FormulaArray VBA

  1. #1

    Ctrl Shift Enter on FormulaArray VBA

    Hi all , I have a formula Vlookup with multi condition like this:
    =VLOOKUP(B3&E3&G3,CHOOSE({1,2},B:B&E:E&G:G,C:C),2,0)
    It works if Ctrl Shift Enter on formula to formula array.
    So I rewrite it into VBA like
    Workbooks(wb_name).Range("C3").FormulaArray="=VLOOKUP(B3&E3&G3,CHOOSE({1,2},B:B&E:E&G:G,C:C),2,0)"
    But it only show formula and I must focus on it then Ctrl Shift Enter to display value return.
    How to solve this issuse. Please help me.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You have to reference the sheet not the workbook, and if you do that works fine for me.

    But what is the point of the formula, it will always return what is in C3, as you lookup values are in the lookup ranges.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Quote Originally Posted by xld View Post
    You have to reference the sheet not the workbook, and if you do that works fine for me.

    But what is the point of the formula, it will always return what is in C3, as you lookup values are in the lookup ranges.
    I have just already fixedWorkbooks(wb_name).Sheets(sheet_name).Range("C3").FormulaArray. But it doesn't work.
    If i change to Workbooks(wb_name).Sheets(sheet_name).Range("C3").Formula= then the row has value as formula as #N/A, but i need to Ctrl Shift Enter to return exact value.

    C3 is default cell value will be return. It is absolutely


Posting Permissions

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