Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default VLookUp in Macro not compiling

You can't do an Application.VLOOKUP on a closed workbook. Worksheet
function, yes, VBA, no.

--
HTH

Bob Phillips

"Craigm" wrote in
message ...

'=IF($AA3< "

",VLOOKUP(ABS($AA3),'C:\Reference\[TranMaster.xls]Translator'!$A$11:$AC$54,2
,TRUE),"
")

The above VLookUp statement runs great when its in a cell.

In a macro it won't compile. At the ' in front of 'C:\Reference\...
the compiler says "Expected Expression."

Below is what is actually crashing

===============
If (sBreakDown < " ") Then
sDistrict =

Application.VLOOKUP(ActiveSheet.Cells(i,1),'C:\Ref erence\[TranMaster.xls]Tra
nslator'!$A$11:$AC$54,2,TRUE),"
")
End If
===============

Thanks for helping..Too many hours, not enough sleep! Craigm


--
Craigm
------------------------------------------------------------------------
Craigm's Profile:

http://www.excelforum.com/member.php...o&userid=24381
View this thread: http://www.excelforum.com/showthread...hreadid=383822



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VLookUp in Macro not compiling


The worksheet is open. I open it in Excel manually.

sDistrict = Application.VLookup("1701-31-0000-301"
Workbooks("C:\Reference\TranMaster.xls").Sheets("T ranslator").Range("A11:C55")
2, True)

I am still having trouble getting to the WorkBook "TranMaster" an
WorkSheet "Translator"

I tried taking out the "'C:\Reference\TranMaster.xls") and change
.Sheets to WorkSheets. I can access the WorkSheet as long as it is i
the same Workbook.

It's looking into other WorkBooks that I falldown!

I am lost on this one!

Thanks for your help!

Crai

--
Craig
-----------------------------------------------------------------------
Craigm's Profile: http://www.excelforum.com/member.php...fo&userid=2438
View this thread: http://www.excelforum.com/showthread.php?threadid=38382

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default VLookUp in Macro not compiling

Don't know where you are reading the responses but as I said elesewhere

sDistrict = Application.VLookup("1701-31-0000-301",
Workbooks("TranMaster.xls").Sheets("Translator").R ange("A11:C55"), 2, True)

--
HTH

Bob Phillips

"Craigm" wrote in
message ...

The worksheet is open. I open it in Excel manually.

sDistrict = Application.VLookup("1701-31-0000-301",

Workbooks("C:\Reference\TranMaster.xls").Sheets("T ranslator").Range("A11:C55
"),
2, True)

I am still having trouble getting to the WorkBook "TranMaster" and
WorkSheet "Translator"

I tried taking out the "'C:\Reference\TranMaster.xls") and changed
Sheets to WorkSheets. I can access the WorkSheet as long as it is in
the same Workbook.

It's looking into other WorkBooks that I falldown!

I am lost on this one!

Thanks for your help!

Craig


--
Craigm
------------------------------------------------------------------------
Craigm's Profile:

http://www.excelforum.com/member.php...o&userid=24381
View this thread: http://www.excelforum.com/showthread...hreadid=383822



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VLookUp in Macro not compiling


With your help I've got it working

--
Craig
-----------------------------------------------------------------------
Craigm's Profile: http://www.excelforum.com/member.php...fo&userid=2438
View this thread: http://www.excelforum.com/showthread.php?threadid=38382

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
compiling data from multiple Excel sheets - macro? Stephanie Mistretta Excel Worksheet Functions 2 April 23rd 08 11:44 AM
Macro compiling screen andrewbt Excel Discussion (Misc queries) 1 July 27th 07 12:04 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Add not compiling will Excel Programming 4 May 19th 04 01:18 PM
Compiling a macro as a .exe? tehwa[_4_] Excel Programming 1 December 29th 03 04:58 AM


All times are GMT +1. The time now is 03:46 AM.

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"