ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Import a CSV file HELP (https://www.excelbanter.com/excel-programming/358336-import-csv-file-help.html)

melissad

Import a CSV file HELP
 

I am not sure if this in the right forum, but I need help.

OK I have two spreadsheets. One spreadsheet (out of stock) shows model
numbers that have been taken out of stock. The other spreadsheet
(stock) shows the same model numbers and a quantity field.

I need to be able to make the model numbers from the out of stock
spreadsheet to be filtered (?) in to my stock spreadsheet and recognize
which items are out of stock and change the quanity field to zero.

right now the stock spreadsheet has a model # column and a product
quantity column, the model # column has numbers in the the product
quantity has the number 20 in it all the way down. I should mention
there are 6000 rows in the stock spreadsheet.

How can I accomplish this??

Thank you. If I didnt explain it right, please ask questions.

Melissa


--
melissad
------------------------------------------------------------------------
melissad's Profile: http://www.excelforum.com/member.php...o&userid=33273
View this thread: http://www.excelforum.com/showthread...hreadid=530974


Tom Ogilvy

Import a CSV file HELP
 
This untested code should get you started. Adjust names and sheet references
to fit your actual situation.

Assumes Product Numbers are in column A starting in row 2 and for the Stock
sheet, the quantities are in column B.

Sub ABC()
Dim rng as Range, rng1 as Range
Dim cell as Range
with Workbooks("Stock.CSV").Worksheets(1)
set rng = .Range(.Cells(2,1),.Cells(rows.count,1).End(xlup))
End with
With workbooks("Out of Stock.csv").Worksheets(1)
set rng1 = .Range(.Cells(2,1),.Cells(rows.count,1).End(xlup))
End with

for each cell in rng
if application.Countif(rng1,cell) 0 then
cell.offset(0,1).Value = 0
end if
Next
End Sub

--
Regards,
Tom Ogilvy

"melissad" wrote:


I am not sure if this in the right forum, but I need help.

OK I have two spreadsheets. One spreadsheet (out of stock) shows model
numbers that have been taken out of stock. The other spreadsheet
(stock) shows the same model numbers and a quantity field.

I need to be able to make the model numbers from the out of stock
spreadsheet to be filtered (?) in to my stock spreadsheet and recognize
which items are out of stock and change the quanity field to zero.

right now the stock spreadsheet has a model # column and a product
quantity column, the model # column has numbers in the the product
quantity has the number 20 in it all the way down. I should mention
there are 6000 rows in the stock spreadsheet.

How can I accomplish this??

Thank you. If I didnt explain it right, please ask questions.

Melissa


--
melissad
------------------------------------------------------------------------
melissad's Profile: http://www.excelforum.com/member.php...o&userid=33273
View this thread: http://www.excelforum.com/showthread...hreadid=530974




All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com