Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Vlookup from close sheet via VBA

Hi,
I managed to do a vlookup from a closed file via:
=VLOOKUP(A1,'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18,3,FALSE)

but I do not manage to do it by code - I think the problem is that I do not
know the sytax to put 'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18 in VBA.
Can you help, many thanks,
Dan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Vlookup from close sheet via VBA


FormualStr = "=VLOOKUP(A1,'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18,3,FALSE)"
Range("B1).formula = FormulaStr


"Dan" wrote:

Hi,
I managed to do a vlookup from a closed file via:
=VLOOKUP(A1,'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18,3,FALSE)

but I do not manage to do it by code - I think the problem is that I do not
know the sytax to put 'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18 in VBA.
Can you help, many thanks,
Dan

  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Vlookup from close sheet via VBA

Thanks, but that is not what I am after- you are just assigning a formula
via code - nothing to do with vlookup.

I want to use Application.VLookup...

Thanks

"Joel" wrote:


FormualStr = "=VLOOKUP(A1,'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18,3,FALSE)"
Range("B1).formula = FormulaStr


"Dan" wrote:

Hi,
I managed to do a vlookup from a closed file via:
=VLOOKUP(A1,'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18,3,FALSE)

but I do not manage to do it by code - I think the problem is that I do not
know the sytax to put 'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18 in VBA.
Can you help, many thanks,
Dan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Vlookup from close sheet via VBA

Hi,

You can't do a Vlookup in VBA on a closed workbook so you have options.

1. fleeting open the workbook do the lookup and capture the value
or
2. Write a formula to the worksheet capture the value and delete the formula

Mike

"Dan" wrote:

Hi,
I managed to do a vlookup from a closed file via:
=VLOOKUP(A1,'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18,3,FALSE)

but I do not manage to do it by code - I think the problem is that I do not
know the sytax to put 'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18 in VBA.
Can you help, many thanks,
Dan

  #5   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Vlookup from close sheet via VBA

Thank you

"Mike H" wrote:

Hi,

You can't do a Vlookup in VBA on a closed workbook so you have options.

1. fleeting open the workbook do the lookup and capture the value
or
2. Write a formula to the worksheet capture the value and delete the formula

Mike

"Dan" wrote:

Hi,
I managed to do a vlookup from a closed file via:
=VLOOKUP(A1,'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18,3,FALSE)

but I do not manage to do it by code - I think the problem is that I do not
know the sytax to put 'C:\temp\[test3.xls]Sheet1'!$A$1:$C$18 in VBA.
Can you help, many thanks,
Dan

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 on close file Dan Excel Worksheet Functions 2 June 3rd 08 03:47 PM
VLOOKUP Closest Match Not Close Enough Ronster Excel Programming 11 December 15th 05 01:06 AM
Before close - not always deleting sheet- WHY?? Patti[_2_] Excel Programming 2 August 2nd 05 05:08 PM
Close Hidden Data Sheet Jeff Excel Programming 7 January 8th 05 09:48 PM
Hanging on sheet close Jesse[_4_] Excel Programming 2 December 4th 03 09:21 AM


All times are GMT +1. The time now is 04:47 PM.

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

About Us

"It's about Microsoft Excel"