Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
SteveG
 
Posts: n/a
Default MACRO Help


Assuming that each Part Number has a unique Employee id then you don't
need to use a macro if you don't want. Create a table with Part Number
in column J and corresponding Employee in K. Sort in ascending order by
Part Number.

In your sheet, say your Part Number is input in column A and the
Employee number you want to automatically fill is in column B. In B2.

=VLOOKUP(A2,$J$1:$K$6,2,FALSE)

This looks up the Part Number in A2 and compares it to the table you
created and returns the corresponding Employee number from that table.
For asthetic purposes, hide the columns containing your tables if you
don't want them to be seen. You could also create the table in a
separate worksheet altogether and hide that from view as well. In
order to see the preceding zeros in your results (Employee Id = 001)
format your cells as 000.



Cheers,

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=488714

 
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
Editing a simple macro Connie Martin Excel Worksheet Functions 5 November 29th 05 09:19 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


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