Need help with VBA code or function

R

ryan.fitzpatrick3

I have a workbook that has 2 pages. One page has rows with the data
below. I manually type in the Quantities in the respective months Jan,
Fed, Mar, etc. The data on the Pulled from Access sheet is a table
that I pull info from Microsoft Access. You see how the quantities on
sheet 2 go into sheet1 (because I type them). I would like a macro or
code where on a button I can automatically put the correct quantity
into the correct plant, item#, month, year. I tried if statements to
see if criteria Plant, item#, month and year, if it met all those, it
would put the quantity into the respective cell on sheet 1. Like an
auto find. I've tried vlookup but I need it to recognize all the
criteria instead of one, and since the information on sheet 2 is
updated every other day it would still recognize the certain criteria.
(I have the months in numeric, such as 1 for jan, 2 for feb, etc) This
is how it's pulled from microsoft access. FYI. Can this be done? Does
this make sense?

"Data" Sheet (sheet1)

(2007) ----------- Quantites-----------
r1 Plant Vendor Item# Flour Jan
Feb Mar
r2 8103 ConAgra 300365 White 1,550,390
1,356,920 1,292,750
r3 8103 ConAgra 300366 Wheat 223,030 159,660
160,480

"Pulled from Access" Sheet (sheet2)

Comp Branch Vend ID Vender Name Item # Item Desc Month Year
Quantity

US 8103 831381 CONAGRA INC 300365 FLOUR 01 07 1,550,390
US 8103 831381 CONAGRA INC 300365 FLOUR 02 07 1,356,920
US 8103 831381 CONAGRA INC 300365 FLOUR 03 07 1,292,750
US 8103 831381 CONAGRA INC 300365 FLOUR 04 07 1,346,200
US 8103 831381 CONAGRA INC 300365 FLOUR 05 07 1,750,020


I appreciate any help.

Ryan
 
M

marcus

Hi Ryan

This may be over simplistic by why don't you use a pivot table to
summarise the data from Sheet 2. This would capture all of the
information you require and summarise it accordingly.

If you need further help on pivot tables or an alternative solution
just ask.

Take care

Marcus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top