#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default First Time Macro

I am seeking assistance in creating a macro for the first time. I have two
Excel files (File1 and File2). Column "R" in File1 is formated as text
numbers. When I type in a value (e.g. "015") I would like a command in File1
that says, "go to File2, Column A, Row 1 to find a match. If no match go to
Row 2, Row 3 etc. until it finds a match. When it does find a match, pick up
what is in that Row/Column F File2 and put it into File1, Column "S", the
same Row I was in when I typed the "015" in Column "R".

It's basic "look-up", but I've no idea how to write it; type (e.e. 015) in
the first file, go to the second file, find a match and pick up the data in
the corresponding cell and copy it into the specified cell in first file.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default First Time Macro

Open File2... assuming lookup range is A:B in Sheet1

Enter this formula in S1 of File1
=VLOOKUP(R1,[File2.xls]Sheet1!$A:$B,2,FALSE)

If you close File2 its complete path will be added by Excel before its name.

"Greensearch" wrote:

I am seeking assistance in creating a macro for the first time. I have two
Excel files (File1 and File2). Column "R" in File1 is formated as text
numbers. When I type in a value (e.g. "015") I would like a command in File1
that says, "go to File2, Column A, Row 1 to find a match. If no match go to
Row 2, Row 3 etc. until it finds a match. When it does find a match, pick up
what is in that Row/Column F File2 and put it into File1, Column "S", the
same Row I was in when I typed the "015" in Column "R".

It's basic "look-up", but I've no idea how to write it; type (e.e. 015) in
the first file, go to the second file, find a match and pick up the data in
the corresponding cell and copy it into the specified cell in first file.

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
Macro / function text time to 24hr excel time passed midnight fortotaling hr's Russmaz Excel Worksheet Functions 2 March 6th 09 04:58 AM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Time 24:00:00 in macro NC Excel Discussion (Misc queries) 2 March 11th 07 11:55 AM
Can I get a macro to run at a certain time of day? Nick123 Excel Discussion (Misc queries) 2 July 27th 05 11:31 AM


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

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"