ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VLOOKUP into another workbook (https://www.excelbanter.com/excel-programming/290044-vlookup-into-another-workbook.html)

L Mehl

VLOOKUP into another workbook
 
Hello --

Can someone show me the format for using VLOOKUP in VBA to get a value from
an xls in another folder?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], " ", etc. to
make it reference an xls in another folder, using VBA.

Thanks for any help.

Larry Mehl


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004



Bob Phillips[_6_]

VLOOKUP into another workbook
 
Hi Larry,

=VLOOKUP("Chelsea",'D:\Bob\My Documents\My Spreadsheets\[Premiership
2003.xls]League Table'!$B$3:$Z$22,25,FALSE)

'D:\Bob\My Documents\My Spreadsheets\[Premiership 2003.xls] is the workbook

League Table is the sheet
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Hello --

Can someone show me the format for using VLOOKUP in VBA to get a value

from
an xls in another folder?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], " ", etc. to
make it reference an xls in another folder, using VBA.

Thanks for any help.

Larry Mehl


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004





L Mehl

VLOOKUP into another workbook
 
Bob --

Thanks.

Is that code for use in VBA to get a value from an xls in another folder?

I get the error
"Expected: Expression"
when I adapt it to my scenario.

Thanks for any help.

Larry Mehl


"Bob Phillips" wrote in message
...
Hi Larry,

=VLOOKUP("Chelsea",'D:\Bob\My Documents\My Spreadsheets\[Premiership
2003.xls]League Table'!$B$3:$Z$22,25,FALSE)

'D:\Bob\My Documents\My Spreadsheets\[Premiership 2003.xls] is the

workbook

League Table is the sheet
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Hello --

Can someone show me the format for using VLOOKUP in VBA to get a value

from
an xls in another folder?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], " ", etc.

to
make it reference an xls in another folder, using VBA.

Thanks for any help.

Larry Mehl


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004



Bob Phillips[_6_]

VLOOKUP into another workbook
 
Larry,

No it is worksheet formula. It is exactly as I created on my system and did
work.

Post your adapted version and let's see if we can work out what it should
be.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Bob --

Thanks.

Is that code for use in VBA to get a value from an xls in another folder?

I get the error
"Expected: Expression"
when I adapt it to my scenario.

Thanks for any help.

Larry Mehl


"Bob Phillips" wrote in message
...
Hi Larry,

=VLOOKUP("Chelsea",'D:\Bob\My Documents\My Spreadsheets\[Premiership
2003.xls]League Table'!$B$3:$Z$22,25,FALSE)

'D:\Bob\My Documents\My Spreadsheets\[Premiership 2003.xls] is the

workbook

League Table is the sheet
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Hello --

Can someone show me the format for using VLOOKUP in VBA to get a value

from
an xls in another folder?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], " ",

etc.
to
make it reference an xls in another folder, using VBA.

Thanks for any help.

Larry Mehl


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004





L Mehl

VLOOKUP into another workbook
 
Hi Bob,

Thanks for the offer of help.
The result of building the lookup in workbook on c:
(in part, by pointing to the data lookup range in the other workbook)
is
=VLOOKUP(1,'C:\...path...\TA_TestScript.xls'!TestC aseInfo,3,FALSE)

Using this in VBA as
variable =
Application.WorksheetFunction.VLOOKUP(1,'C:\...pat h...\TA_TestScript.xls'!Te
stCaseInfo,3,FALSE)
gives the error
"Expected: Expression"

Is this enough for you to comment on?

Larry


"Bob Phillips" wrote in message
...
Larry,

No it is worksheet formula. It is exactly as I created on my system and

did
work.

Post your adapted version and let's see if we can work out what it should
be.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Bob --

Thanks.

Is that code for use in VBA to get a value from an xls in another

folder?

I get the error
"Expected: Expression"
when I adapt it to my scenario.

Thanks for any help.

Larry Mehl


"Bob Phillips" wrote in message
...
Hi Larry,

=VLOOKUP("Chelsea",'D:\Bob\My Documents\My Spreadsheets\[Premiership
2003.xls]League Table'!$B$3:$Z$22,25,FALSE)

'D:\Bob\My Documents\My Spreadsheets\[Premiership 2003.xls] is the

workbook

League Table is the sheet
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Hello --

Can someone show me the format for using VLOOKUP in VBA to get a

value
from
an xls in another folder?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], " ",

etc.
to
make it reference an xls in another folder, using VBA.

Thanks for any help.

Larry Mehl


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004



Frank Kabel

VLOOKUP into another workbook
 
Hi Larry
try changing
=VLOOKUP(1,'C:\...path...\TA_TestScript.xls'!TestC aseInfo,3,FALSE)
to
=VLOOKUP(1,'C:\...path...\[TA_TestScript.xls]'!TestCaseInfo,3,FALSE)
the [...] is required

Frank



L Mehl wrote:
Hi Bob,

Thanks for the offer of help.
The result of building the lookup in workbook on c:
(in part, by pointing to the data lookup range in the other workbook)
is
=VLOOKUP(1,'C:\...path...\TA_TestScript.xls'!TestC aseInfo,3,FALSE)

Using this in VBA as
variable =

Application.WorksheetFunction.VLOOKUP(1,'C:\...pat h...\TA_TestScript.xl
s'!Te
stCaseInfo,3,FALSE)
gives the error
"Expected: Expression"

Is this enough for you to comment on?

Larry


"Bob Phillips" wrote in message
...
Larry,

No it is worksheet formula. It is exactly as I created on my system
and did work.

Post your adapted version and let's see if we can work out what it
should be.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Bob --

Thanks.

Is that code for use in VBA to get a value from an xls in another
folder?

I get the error
"Expected: Expression"
when I adapt it to my scenario.

Thanks for any help.

Larry Mehl


"Bob Phillips" wrote in message
...
Hi Larry,

=VLOOKUP("Chelsea",'D:\Bob\My Documents\My
Spreadsheets\[Premiership 2003.xls]League
Table'!$B$3:$Z$22,25,FALSE)

'D:\Bob\My Documents\My Spreadsheets\[Premiership 2003.xls] is the
workbook

League Table is the sheet
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Hello --

Can someone show me the format for using VLOOKUP in VBA to get a
value from an xls in another folder?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], "
", etc. to make it reference an xls in another folder, using VBA.

Thanks for any help.

Larry Mehl


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004




L Mehl

VLOOKUP into another workbook
 
Hi Frank --

I remember seeing brackets in an example, and then forgot where I saw it.

It still does not work for me.

That notation works in a cell in the xls.

My problem is how to achieve the same result VBA code.

I "duplicated" your notation into VBA, and improvised a little:
Application.WorksheetFunction.VLookup _
(1,
Worksheets("C:\...path...\[TA_TestScript.xls]TestCases").Range("TestCaseInfo
"), 2, 0)

Running in the Immediate Window, I got the error
"Run-time error '9':
Subscript out of range"

Are the " marks in the right place?
Is "Range" needed?
Do I need "Worksheets"?

[ ] are as you described them.

Many combinations to try ...

Thanks in advance for any further help.

Larry


"Frank Kabel" wrote in message
...
Hi Larry
try changing
=VLOOKUP(1,'C:\...path...\TA_TestScript.xls'!TestC aseInfo,3,FALSE)
to
=VLOOKUP(1,'C:\...path...\[TA_TestScript.xls]'!TestCaseInfo,3,FALSE)
the [...] is required

Frank



L Mehl wrote:
Hi Bob,

Thanks for the offer of help.
The result of building the lookup in workbook on c:
(in part, by pointing to the data lookup range in the other workbook)
is
=VLOOKUP(1,'C:\...path...\TA_TestScript.xls'!TestC aseInfo,3,FALSE)

Using this in VBA as
variable =

Application.WorksheetFunction.VLOOKUP(1,'C:\...pat h...\TA_TestScript.xl
s'!Te
stCaseInfo,3,FALSE)
gives the error
"Expected: Expression"

Is this enough for you to comment on?

Larry


"Bob Phillips" wrote in message
...
Larry,

No it is worksheet formula. It is exactly as I created on my system
and did work.

Post your adapted version and let's see if we can work out what it
should be.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Bob --

Thanks.

Is that code for use in VBA to get a value from an xls in another
folder?

I get the error
"Expected: Expression"
when I adapt it to my scenario.

Thanks for any help.

Larry Mehl


"Bob Phillips" wrote in message
...
Hi Larry,

=VLOOKUP("Chelsea",'D:\Bob\My Documents\My
Spreadsheets\[Premiership 2003.xls]League
Table'!$B$3:$Z$22,25,FALSE)

'D:\Bob\My Documents\My Spreadsheets\[Premiership 2003.xls] is the
workbook

League Table is the sheet
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"L Mehl" wrote in message
...
Hello --

Can someone show me the format for using VLOOKUP in VBA to get a
value from an xls in another folder?

In a worksheet
=VLOOKUP(1,TA_TestScript.xls!TestCases,2,FALSE)

TA_TestScript.xls is the closed file

works, but I can't figure out the correct combination of [ ], "
", etc. to make it reference an xls in another folder, using VBA.

Thanks for any help.

Larry Mehl


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004




All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com