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

Using Excel 97

I have another software program that produces a parts
list (Column A) and a corresponding quantity (Column B)

I need to look up a part number in column A (part No
109000) and set its quantity to zero (column B).

I can manually set a formula in another cell (column
C) "IF(A17=109000,(VLOOKUP(A17,$A$17:$B$1000,2,FALSE) ))"
and "drag" the formula into the cells beneath in its
column.

This function gives a value of value of "0" as required
if the part number equals 109000 and returns the correct
quantity of all other part numbers until the second parts
list is encountered then it all goes up in smoke!!!!

Ultimately I need to .:-

1) get the second, third etc parts list to work
2) and secondly try to automate this in to a code module

Any ideas???

Part № Qty New Qty
101106 18 18
101109 24 24
101112 6 6
101118 84 84
101127 5 5
101133 8 8
101500 290 290
102521 97 97
102622 176 176
103312 28 28
103975 169 169
107851 11 11
107852 1 1
109000 20 0
109010 21 21
109015 146 146
#N/A
Part № Qty Qty
101115 3 3
101118 2 84
101500 10 290
102236 2 2
102521 5 97
102622 26 176
103975 26 169
109000 50 0
109020 7 7
109030 19 19
109108 4 4
109112 2 2
109118 30 30



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default VLOOKUP

WAYNE,
Why Vlookup? Just use
=IF(A17=109000,0,B17)
Cecil


"" wrote in message
...
Using Excel 97

I have another software program that produces a parts
list (Column A) and a corresponding quantity (Column B)

I need to look up a part number in column A (part No
109000) and set its quantity to zero (column B).

I can manually set a formula in another cell (column
C) "IF(A17=109000,(VLOOKUP(A17,$A$17:$B$1000,2,FALSE) ))"
and "drag" the formula into the cells beneath in its
column.

This function gives a value of value of "0" as required
if the part number equals 109000 and returns the correct
quantity of all other part numbers until the second parts
list is encountered then it all goes up in smoke!!!!

Ultimately I need to .:-

1) get the second, third etc parts list to work
2) and secondly try to automate this in to a code module

Any ideas???

Part № Qty New Qty
101106 18 18
101109 24 24
101112 6 6
101118 84 84
101127 5 5
101133 8 8
101500 290 290
102521 97 97
102622 176 176
103312 28 28
103975 169 169
107851 11 11
107852 1 1
109000 20 0
109010 21 21
109015 146 146
#N/A
Part № Qty Qty
101115 3 3
101118 2 84
101500 10 290
102236 2 2
102521 5 97
102622 26 176
103975 26 169
109000 50 0
109020 7 7
109030 19 19
109108 4 4
109112 2 2
109118 30 30





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default VLOOKUP

I think one manual way of doing this is to apply data|filter|autofilter.

Filter on just the (one?) part number that should be 0 and change it manually.

If I wanted a macro, I think I'd use the Find method (like Edit|Find):

Option Explicit
Sub testme01()
Dim FoundCell As Range
Dim FirstAddress As String
Dim FindWhat As String

FindWhat = "109000"

With Worksheets("sheet1").Range("a:a")
Set FoundCell = .Cells.Find(what:=FindWhat, _
after:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, lookat:=xlWhole)

If FoundCell Is Nothing Then
'do nothing
Else

FirstAddress = FoundCell.Address
Do
FoundCell.Offset(0, 1).Value = 0
Set FoundCell = .FindNext(FoundCell)
Loop While Not FoundCell Is Nothing _
And FoundCell.Address < FirstAddress
End If
End With
End Sub

This is pretty much taken out of the help for Find.



WAYNE wrote:

Using Excel 97

I have another software program that produces a parts
list (Column A) and a corresponding quantity (Column B)

I need to look up a part number in column A (part No
109000) and set its quantity to zero (column B).

I can manually set a formula in another cell (column
C) "IF(A17=109000,(VLOOKUP(A17,$A$17:$B$1000,2,FALSE) ))"
and "drag" the formula into the cells beneath in its
column.

This function gives a value of value of "0" as required
if the part number equals 109000 and returns the correct
quantity of all other part numbers until the second parts
list is encountered then it all goes up in smoke!!!!

Ultimately I need to .:-

1) get the second, third etc parts list to work
2) and secondly try to automate this in to a code module

Any ideas???

Part № Qty New Qty
101106 18 18
101109 24 24
101112 6 6
101118 84 84
101127 5 5
101133 8 8
101500 290 290
102521 97 97
102622 176 176
103312 28 28
103975 169 169
107851 11 11
107852 1 1
109000 20 0
109010 21 21
109015 146 146
#N/A
Part № Qty Qty
101115 3 3
101118 2 84
101500 10 290
102236 2 2
102521 5 97
102622 26 176
103975 26 169
109000 50 0
109020 7 7
109030 19 19
109108 4 4
109112 2 2
109118 30 30



--

Dave Peterson

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
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM


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