Import data for Inventory

chefdt

Board Regular
Joined
Jul 1, 2008
Messages
163
I am working with a food inventory workbook. Let's call it inventory.xls. It has worksheets named for food categories such as meat, dairy, etc.

I need a macro that will scan a new worksheet (import.xls) with food items sorted by category and copy them to the appropriate worksheets in the INVENTORY Workbook, starting at row 8 on the existing sheet within inventory.xls

Below is an example of both worksheets.

inventory.xls
DAIRY

ABCDEFGHIJKLM

<colgroup><col style="WIDTH: 30px; FONT-WEIGHT: bold"><col style="WIDTH: 56px"><col style="WIDTH: 209px"><col style="WIDTH: 73px"><col style="WIDTH: 35px"><col style="WIDTH: 71px"><col style="WIDTH: 73px"><col style="WIDTH: 81px"><col style="WIDTH: 54px"><col style="WIDTH: 30px"><col style="WIDTH: 30px"><col style="WIDTH: 52px"><col style="WIDTH: 48px"><col style="WIDTH: 54px"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="bgcolor: #c0c0c0, colspan: 2, align: right"]Todays Date:[/TD]
[TD="bgcolor: #c0c0c0, colspan: 2, align: center"]12/20/2010[/TD]

[TD="bgcolor: #c0c0c0, colspan: 2, align: center"]Total:[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]

[TD="bgcolor: #c0c0c0, colspan: 2, align: right"]Date of Last Inventory:[/TD]
[TD="bgcolor: #c0c0c0, colspan: 2, align: center"]11/30/2010[/TD]

[TD="bgcolor: #c0c0c0, align: right"]$ - [/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="bgcolor: #c0c0c0, colspan: 2, align: right"]Days Since Last Inventory:[/TD]
[TD="bgcolor: #c0c0c0, colspan: 2, align: center"]20[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="bgcolor: #c0c0c0, colspan: 2, align: right"]Last Person to Inventory:[/TD]
[TD="bgcolor: #c0c0c0, colspan: 2"][/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]

[TD="colspan: 3"][/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]
[TD="bgcolor: #800000, align: center"]SUPC[/TD]
[TD="bgcolor: #800000, align: center"]Item Description[/TD]
[TD="bgcolor: #800000, align: center"]Brand[/TD]
[TD="bgcolor: #800000, align: center"]Count[/TD]
[TD="bgcolor: #800000, align: center"]Package Size[/TD]
[TD="bgcolor: #800000, align: center"]Mfg #[/TD]
[TD="bgcolor: #800000, align: center"]Re-order Count[/TD]
[TD="bgcolor: #800000, align: center"]Case Cost[/TD]
[TD="bgcolor: #800000, align: center"]Case[/TD]
[TD="bgcolor: #800000, align: center"]Each[/TD]
[TD="bgcolor: #003366, align: center"]Unit Cost [/TD]
[TD="bgcolor: #003366, align: center"]Units in Stock [/TD]
[TD="bgcolor: #003366, align: center"]Total $ [/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]

[TD="bgcolor: #ccccff, align: center"]- [/TD]
[TD="bgcolor: #ccccff, align: right"][/TD]
[TD="bgcolor: #ccccff"]- [/TD]

[TD="bgcolor: #cacaca, align: center"]9[/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0"][/TD]
[TD="bgcolor: #c0c0c0, align: center"]- [/TD]
[TD="bgcolor: #c0c0c0, align: right"][/TD]
[TD="bgcolor: #c0c0c0"]- [/TD]

</tbody>


import.xls
Sheet1


ABCDEFG
DAIRY PRODUCTS












BUTTERMILK 1% LOW FAT/.5 GALWHLFARM
CHEESE AMER LOAF YEL ^Only/5 LBBBRLCLS
CHEESE AMER YEL 120 SLI ^/5 LBBBRLCLS
CHEESE CHDR SHRD YEL FCY MILD^Only/5 LBCASASOL
CHEESE COTTAGE SMALL CURD 2% ^/5 LBWHLFARM
CHEESE CREAM NEUFCH 1/3 LS FATOnly/3 LBSYS IMP
CHEESE CUBE CHDR/COJCK/PEP JCK/5#BBRLIMP
CHEESE PARM SHAVEDOnly/5 LBBELGIO
CHEESE SWISS SLI/1.5 LBBBRLIMP
CREAM SOUR CULTRD GRADE A ^/5 LBWHLFARM
CREAM SOUR PURE GRD A SQ PACKT/1 OZDAISY
CREAM WHIPPING HVY 40% FRSH/32 OZWHLFARM
EGG SHELL MED GR AA USDA WHT/15 DZWHLFCLS
ICE CREAM VAN/3 GALWHLFREL
MARGARINE SOFT BUTRY SPREAD/5 GMSMT BAL
MARGARINE SOLID ALL VEG/1 LBWHLFCLS
TOPPING WHPD IN BAG/16 OZWHLFCLS
MEATS












BACON END & PIECESOnly/3 LBFARMLND
BACON LAYFLAT 18/22 CT ^/15 LBSYS REL
BACON SLAB SLI 18/22CT TX SMK^/15 LBSYS REL
BEEF CORNED SLI/2 LBHORMEL

<colgroup><col style="WIDTH: 30px; FONT-WEIGHT: bold"><col style="WIDTH: 48px"><col style="WIDTH: 48px"><col style="WIDTH: 48px"><col style="WIDTH: 48px"><col style="WIDTH: 48px"><col style="WIDTH: 48px"><col style="WIDTH: 48px"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]
[TD="align: right"]8965881[/TD]

[TD="align: right"] 9[/TD]

[TD="align: right"]19.95[/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]
[TD="align: right"]6267272[/TD]

[TD="align: right"]14.99[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]
[TD="align: right"]6697114[/TD]

[TD="align: right"] 4[/TD]

[TD="align: right"]43.61[/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]
[TD="align: right"]2406163[/TD]

[TD="align: right"]12.98[/TD]

[TD="bgcolor: #cacaca, align: center"]9[/TD]
[TD="align: right"]8953028[/TD]

[TD="align: right"] 2[/TD]

[TD="align: right"]24.50[/TD]

[TD="bgcolor: #cacaca, align: center"]10[/TD]
[TD="align: right"]2006559[/TD]

[TD="align: right"]6.77[/TD]

[TD="bgcolor: #cacaca, align: center"]11[/TD]
[TD="align: right"]7234958[/TD]

[TD="align: right"] 3[/TD]

[TD="align: right"]75.25[/TD]

[TD="bgcolor: #cacaca, align: center"]12[/TD]
[TD="align: right"]9714023[/TD]

[TD="align: right"]22.27[/TD]

[TD="bgcolor: #cacaca, align: center"]13[/TD]
[TD="align: right"]8256323[/TD]

[TD="align: right"] 8[/TD]

[TD="align: right"]49.11[/TD]

[TD="bgcolor: #cacaca, align: center"]14[/TD]
[TD="align: right"]5020193[/TD]

[TD="align: right"] 2[/TD]

[TD="align: right"]20.83[/TD]

[TD="bgcolor: #cacaca, align: center"]15[/TD]
[TD="align: right"]5321906[/TD]

[TD="align: right"]100[/TD]

[TD="align: right"]10.39[/TD]

[TD="bgcolor: #cacaca, align: center"]16[/TD]
[TD="align: right"]0012104[/TD]

[TD="align: right"] 8[/TD]

[TD="align: right"]31.05[/TD]

[TD="bgcolor: #cacaca, align: center"]17[/TD]
[TD="align: right"]2105815[/TD]

[TD="align: right"] 1[/TD]

[TD="align: right"]16.99[/TD]

[TD="bgcolor: #cacaca, align: center"]18[/TD]
[TD="align: right"]2130060[/TD]

[TD="align: right"] 1[/TD]

[TD="align: right"]17.19[/TD]

[TD="bgcolor: #cacaca, align: center"]19[/TD]
[TD="align: right"]6631347[/TD]

[TD="align: right"]600[/TD]

[TD="align: right"]27.33[/TD]

[TD="bgcolor: #cacaca, align: center"]20[/TD]
[TD="align: right"]0417527[/TD]

[TD="align: right"] 30[/TD]

[TD="align: right"]20.31[/TD]

[TD="bgcolor: #cacaca, align: center"]21[/TD]
[TD="align: right"]2389534[/TD]

[TD="align: right"] 12[/TD]

[TD="align: right"]35.31[/TD]

[TD="bgcolor: #cacaca, align: center"]22[/TD]

[TD="bgcolor: #cacaca, align: center"]23[/TD]

[TD="bgcolor: #cacaca, align: center"]24[/TD]
[TD="align: right"]1434729[/TD]

[TD="align: right"]10.60[/TD]

[TD="bgcolor: #cacaca, align: center"]25[/TD]
[TD="align: right"]1073402[/TD]

[TD="align: right"] 1[/TD]

[TD="align: right"]56.42[/TD]

[TD="bgcolor: #cacaca, align: center"]26[/TD]
[TD="align: right"]1070218[/TD]

[TD="align: right"] 1[/TD]

[TD="align: right"]39.88[/TD]

[TD="bgcolor: #cacaca, align: center"]27[/TD]
[TD="align: right"]6632582[/TD]

[TD="align: right"] 6[/TD]

[TD="align: right"]66.66[/TD]

</tbody>


I need all of the items under the "DAIRY PRODUCTS" to write to a sheet in inventory.xls called "DAIRY" and so on with each category.

I can write a simple macro that will normalize the data into the correct columns before it is written to the new sheets.

Can anyone help me?

Dale
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top