in Education by
I have a master spreadsheet that analyzes records from another spreadsheet with rows going all the way up to 1.4 million. Below are the relevant pieces from the code: Sub Whyamidoingthis() Dim USISINLfp As String Dim ISINL As String Dim echeck As String Dim wUSISIN As Workbook Dim lastrow As Long Dim Result As Worksheet Dim i As Long Set OutShVar = ThisWorkbook.Worksheets("in1") ISINL = "CONSOLIDATED - Country_Of_Incorp_US_2019-03-01 (Consolidated).xlsx" USISINLfp = "W:\Product Platforms\ISIN- CUSIP Country of Incorporation\March 2019\" Workbooks.Open (USISINLfp & ISINL) Set wUSISIN = Workbooks(ISINL) With Result lastrow = .Cells(.Rows.Count, "H").End(xlUp).Row End With 'US Security 1 For i = 2 To lastrow With Result echeck = Trim(.Range("O" & i)) If echeck = "" Then .Range("P" & i & ":Q" & i).Value = "N" Else .Range("P" & i).Value = "=ifna(vlookup(O" & i & "," & ISINL & "First Sheet'!$B:$C,2,false)," & Chr(34) & "N" & Chr(34) & ")" .Range("Q" & i).Value = "=ifna(vlookup(O" & i & "," & ISINL & "Second Sheet'!$B:$C,2,false)," & Chr(34) & "N" & Chr(34) & ")" 'Debug.Print "=ifna(vlookup(O" & i & "," & ISINL & "Second Sheet'!$B:$C,2,0)," & Chr(34) & "N" & Chr(34) & ")" End If 'US Security 2 echeck = Trim(.Range("S" & i)) If echeck = "" Then .Range("T" & i & ":U" & i).Value = "N" Else .Range("T" & i).Value = "=ifna(vlookup(S" & i & "," & ISINL & "First Sheet'!$A:$C,3,false)," & Chr(34) & "N" & Chr(34) & ")" .Range("U" & i).Value = "=ifna(vlookup(S" & i & "," & ISINL & "Second Sheet'!$A:$C,3,false)," & Chr(34) & "N" & Chr(34) & ")" End If End With Next I If Not wUSISIN Is Nothing Then wUSISIN.Close savechanges:=False End Sub The code is getting stuck at the following line: .Range("T" & i).Value = "=ifna(vlookup(S" & i & "," & ISINL & "First Sheet'!$A:$C,3,false)," & Chr(34) & "N" & Chr(34) & ")" Whenever a result is found and the error is application defined error. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Try this formula: "=ifna(vlookup(O" & i & ",'[" & ISINL & "]First Sheet'!$B:$C,2,false)," & Chr(34) & "N" & Chr(34) & ")" This places square brackets around the workbook name and single quotes around the workbook-worksheet combo. See this tutorial about using VLOOKUP from another workbook.

Related questions

0 votes
    I am setting up a VBA userform function for my work that shows available quantities left to order based on ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I want to using sumifs function in VBA. And result paste in same column as previous data. JavaScript ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I'm using excel vba to pull data from a MS Access DB - this is using Excel 2013 and Access 2013 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    I'm working on Excel VBA macros and I want to retrieve data from a MS Access database (.accdb ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    I am trying to retrieve a particular file from multiple FTP servers. those server details are stored in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    As you can see from the code below i m looping an array and if condition met i want to get the ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    What is the easiest way to call a web service from Excel (I am using version 2002)? Please, no ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    What is the easiest way to call a web service from Excel (I am using version 2002)? Please, no ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I'm not sure how exactly to phrase my question. So, I have an interface reference and I'm ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    read the data from employee. text file and sort on age using counting sort,merge sort,quick sort and write ... sortedemponage.txt'. Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    We can import data from another sheet by using the Clipboard. (1 Point) True False Can’t say Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    I have a VBA macro which copies a summary tab from one workbook to another. It works fine in 2010 ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    I would like to move an entire row to the bottom of a spread sheet if the column k contains a 0 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Suppose I have a bunch of "homegeneous" sc-files, and I need to execute one specific sequence of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    If you call javascript window.open and pass a url to a .xls file it open on some machines in the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 23, 2022 in Education by JackTerrance
...