Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default LOOKUP function in VB Macro.

Remove NOGI and NOGO for e-mail address
(NO Garbage In - NO Garbage Out)

Esteemed Group Participants and Lurkers:

I can't seem to get the lookup function to execute in a
complex macro I am writing. Here is what I am trying to
do:

Workbook with active sheet with macro:
H:\Test\MyTestBook.xls Sheet1

Workbook with lookup source:
D:\Work\My WorkBook.xls SheetX

Lookup Table is named "myTable"

The lookup table works fine, but I can't get it to work
inside the macro. I have tried cut and paste and other
things, but haven't gotten anything to work.

Here is the closest I can come:

Dim i As Long
i = 7
Cells(1, i) = Application.WorksheetFunction.Lookup_
(Cells(2,i), 'D:\Work\My WorkBook.xls'!myTable)

Any suggestions as to how to get this to work?

Thank you for any comments, suggestions, or assistance.

Blessings in abundance, all the best, and ENJOY!

Art Du Rea Carlisle, PA USA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default LOOKUP function in VB Macro.

Cells(1, i) = Application.Lookup_
(Cells(2,i), Workbooks("My
WorkBook.xls").Names("myTable").ReferstoRange)

My Workbook.xls must be open.

--
Regards,
Tom Ogilvy


"Art Du Rea" wrote in message
...
Remove NOGI and NOGO for e-mail address
(NO Garbage In - NO Garbage Out)

Esteemed Group Participants and Lurkers:

I can't seem to get the lookup function to execute in a
complex macro I am writing. Here is what I am trying to
do:

Workbook with active sheet with macro:
H:\Test\MyTestBook.xls Sheet1

Workbook with lookup source:
D:\Work\My WorkBook.xls SheetX

Lookup Table is named "myTable"

The lookup table works fine, but I can't get it to work
inside the macro. I have tried cut and paste and other
things, but haven't gotten anything to work.

Here is the closest I can come:

Dim i As Long
i = 7
Cells(1, i) = Application.WorksheetFunction.Lookup_
(Cells(2,i), 'D:\Work\My WorkBook.xls'!myTable)

Any suggestions as to how to get this to work?

Thank you for any comments, suggestions, or assistance.

Blessings in abundance, all the best, and ENJOY!

Art Du Rea Carlisle, PA USA




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
Combining Lookup function and Sum function Cameron Excel Worksheet Functions 2 July 13th 09 02:19 AM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
how to combine an IF Function with a lookup function to determine [email protected] Excel Worksheet Functions 1 December 5th 06 06:09 AM
Pivot table doing a lookup without using the lookup function? NGASGELI Excel Discussion (Misc queries) 0 August 2nd 05 05:08 AM


All times are GMT +1. The time now is 11:33 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"