Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vlookup link within same workbook Melissa Excel Discussion (Misc queries) 1 September 2nd 09 05:06 AM
vlookup other workbook swell estimator[_2_] Excel Discussion (Misc queries) 1 September 9th 08 07:10 PM
vlookup formula different workbook almmohd Excel Worksheet Functions 0 June 28th 06 02:58 PM
Vlookup for two sheets in same workbook Roberta Excel Discussion (Misc queries) 3 February 23rd 05 12:29 PM
VLOOKUP across all sheets in a workbook Pawel P. Excel Worksheet Functions 3 January 13th 05 12:20 AM


All times are GMT +1. The time now is 03:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"