#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Lookup

I want to do a lookup without using the lookup function. Here is the idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have it return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone point me to
a solution?

-- Carlos


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Lookup

right click sheet tabview code insert thismodify to suitSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(Target, [lookuptable], 2, 0)
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
I want to do a lookup without using the lookup function. Here is the

idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have it

return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone point me

to
a solution?

-- Carlos




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Lookup

I'm a bit confused. If you don't have a column for lot numbers, how is
your table "correlating" lot numbers to material thicknesses?


In article ,
"CarlosAntenna" wrote:

I want to do a lookup without using the lookup function. Here is the idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have it return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone point me to
a solution?

-- Carlos

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Lookup

The lot numbers do indeed exist on the _lookup table_. Where I don't want a
column for lot numbers is on the other sheet where I am entering other data.
I want to type a lot number in the thickness column on this second sheet and
have the thickness returned from the lookup table.

-- Carlos

"JE McGimpsey" wrote in message
...
I'm a bit confused. If you don't have a column for lot numbers, how is
your table "correlating" lot numbers to material thicknesses?


In article ,
"CarlosAntenna" wrote:

I want to do a lookup without using the lookup function. Here is the

idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have it

return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup

using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone point

me to
a solution?

-- Carlos



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Lookup

Ah. That does require a Worksheet_Change() macro.

In article ,
"CarlosAntenna" wrote:

The lot numbers do indeed exist on the _lookup table_. Where I don't want a
column for lot numbers is on the other sheet where I am entering other data.
I want to type a lot number in the thickness column on this second sheet and
have the thickness returned from the lookup table.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Lookup

Don,
Thanks for your reply.
I have tried modifying your code to suit, but I have not been successful.
My lookup table is on sheetname "LookUp", columns A:B and is a named range
"lookupt".
The sheet where I want to return the data is sheetname "TestLog" columns F &
G, with different data going into each of the two columns beginning at row 4
thru 400.
Can you help me out with the translation?

My modifications:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(active.cell, lookupt, 2, 0)
Application.EnableEvents = True
End Sub

I'm not sure what your second line is all about.

-- Carlos


"Don Guillett" wrote in message
...
right click sheet tabview code insert thismodify to suitSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(Target, [lookuptable], 2, 0)
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
I want to do a lookup without using the lookup function. Here is the

idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have it

return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup

using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone point

me
to
a solution?

-- Carlos






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Lookup

Your words taken at face value indicated that you wanted to type a value
into ONE cell and have the lookup returned to THAT cell. So, I set it up to
ONLY work on cell A3.

I want to enter a lot number into a cell and have it return
the corresponding material thickness to that same cell.



--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
Don,
Thanks for your reply.
I have tried modifying your code to suit, but I have not been successful.
My lookup table is on sheetname "LookUp", columns A:B and is a named range
"lookupt".
The sheet where I want to return the data is sheetname "TestLog" columns F

&
G, with different data going into each of the two columns beginning at row

4
thru 400.
Can you help me out with the translation?

My modifications:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(active.cell, lookupt, 2, 0)
Application.EnableEvents = True
End Sub

I'm not sure what your second line is all about.

-- Carlos


"Don Guillett" wrote in message
...
right click sheet tabview code insert thismodify to suitSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(Target, [lookuptable], 2, 0)
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
I want to do a lookup without using the lookup function. Here is the

idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have it

return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup

using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone point

me
to
a solution?

-- Carlos








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Lookup

Sorry about that. It made sense when I wrote it, but it sounds different
when you read it back to me.


"Don Guillett" wrote in message
...
Your words taken at face value indicated that you wanted to type a value
into ONE cell and have the lookup returned to THAT cell. So, I set it up

to
ONLY work on cell A3.

I want to enter a lot number into a cell and have it return
the corresponding material thickness to that same cell.



--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
Don,
Thanks for your reply.
I have tried modifying your code to suit, but I have not been

successful.
My lookup table is on sheetname "LookUp", columns A:B and is a named

range
"lookupt".
The sheet where I want to return the data is sheetname "TestLog" columns

F
&
G, with different data going into each of the two columns beginning at

row
4
thru 400.
Can you help me out with the translation?

My modifications:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(active.cell, lookupt, 2, 0)
Application.EnableEvents = True
End Sub

I'm not sure what your second line is all about.

-- Carlos


"Don Guillett" wrote in message
...
right click sheet tabview code insert thismodify to suitSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(Target, [lookuptable], 2, 0)
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
I want to do a lookup without using the lookup function. Here is

the
idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have

it
return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup

using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone

point
me
to
a solution?

-- Carlos










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Lookup

<Attempt to clarify further
Each row contains test data, two of the relevant pieces of data are plate
thicknesses of the top and bottom plate. But the plates are identified by
lot number rather than thickness. The lookup table correlates the lot
number with a thickness. So in each row of test data I want to type in the
lot number for the top plate in column F and for the bottom plate in column
G and have the corresponding thicknesses returned into the same cell where I
typed the lot number.

-- Carlos

"Don Guillett" wrote in message
...
Your words taken at face value indicated that you wanted to type a value
into ONE cell and have the lookup returned to THAT cell. So, I set it up

to
ONLY work on cell A3.

I want to enter a lot number into a cell and have it return
the corresponding material thickness to that same cell.



--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
Don,
Thanks for your reply.
I have tried modifying your code to suit, but I have not been

successful.
My lookup table is on sheetname "LookUp", columns A:B and is a named

range
"lookupt".
The sheet where I want to return the data is sheetname "TestLog" columns

F
&
G, with different data going into each of the two columns beginning at

row
4
thru 400.
Can you help me out with the translation?

My modifications:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(active.cell, lookupt, 2, 0)
Application.EnableEvents = True
End Sub

I'm not sure what your second line is all about.

-- Carlos


"Don Guillett" wrote in message
...
right click sheet tabview code insert thismodify to suitSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(Target, [lookuptable], 2, 0)
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
I want to do a lookup without using the lookup function. Here is

the
idea:

I have a lookup table correlating Lot Numbers to Material Thickness.
In another sheet I want to enter a lot number into a cell and have

it
return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to lookup

using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone

point
me
to
a solution?

-- Carlos










  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Lookup


then something like this might work.

Private Sub Worksheet_Change(ByVal Target As Range)
if target.row<2 then exit sub
Application.EnableEvents = False
if target.column=5 then target.value = Application.VLookup(active.cell,
[lookupt], 2, 0)
if target.column=6 then target.value = Application.VLookup(active.cell,
[lookupt], 3, 0)
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
<Attempt to clarify further
Each row contains test data, two of the relevant pieces of data are plate
thicknesses of the top and bottom plate. But the plates are identified by
lot number rather than thickness. The lookup table correlates the lot
number with a thickness. So in each row of test data I want to type in

the
lot number for the top plate in column F and for the bottom plate in

column
G and have the corresponding thicknesses returned into the same cell where

I
typed the lot number.

-- Carlos

"Don Guillett" wrote in message
...
Your words taken at face value indicated that you wanted to type a value
into ONE cell and have the lookup returned to THAT cell. So, I set it up

to
ONLY work on cell A3.

I want to enter a lot number into a cell and have it return
the corresponding material thickness to that same cell.



--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
Don,
Thanks for your reply.
I have tried modifying your code to suit, but I have not been

successful.
My lookup table is on sheetname "LookUp", columns A:B and is a named

range
"lookupt".
The sheet where I want to return the data is sheetname "TestLog"

columns
F
&
G, with different data going into each of the two columns beginning at

row
4
thru 400.
Can you help me out with the translation?

My modifications:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(active.cell, lookupt, 2, 0)
Application.EnableEvents = True
End Sub

I'm not sure what your second line is all about.

-- Carlos


"Don Guillett" wrote in message
...
right click sheet tabview code insert thismodify to suitSAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$3" Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.VLookup(Target, [lookuptable], 2, 0)
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"CarlosAntenna" wrote in message
...
I want to do a lookup without using the lookup function. Here is

the
idea:

I have a lookup table correlating Lot Numbers to Material

Thickness.
In another sheet I want to enter a lot number into a cell and have

it
return
the corresponding material thickness to that same cell.
I don't want to have a column on the sheet for lot numbers to

lookup
using
the VLOOKUP() function.

Since I can't do it with a function, I think it requires some VBA
programming. Very likely, this has come up before. Can someone

point
me
to
a solution?

-- Carlos












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
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM
Sumproduct - Condition based on lookup of a Lookup Hari Excel Discussion (Misc queries) 12 May 31st 06 09:28 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:10 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"