hi guys, I am new to VBA and I need help copying data from multiple worksheets to a single sheet in the same workbook.
my workbook has 12 worksheets named by their moths. each worksheet has a number of rows that gets updated. please note that some fields of "Importer" are blank. for each worksheet I need to copy all mass values less than 20 and paste them to a new sheet called "under20", and transfer the rest to "over20".
your help will be much appreciated
worksheet 1 : 2017-04
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Importer[/TD]
[TD]Month[/TD]
[TD]Origin[/TD]
[TD]Mass[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]Importer 1[/TD]
[TD]April-17[/TD]
[TD]MZ[/TD]
[TD]100[/TD]
[TD]90[/TD]
[/TR]
[TR]
[TD]Importer 2[/TD]
[TD]April-17[/TD]
[TD]ZM[/TD]
[TD]50[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]Importer 3[/TD]
[TD]April-17[/TD]
[TD]IN[/TD]
[TD]20[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]Importer 1[/TD]
[TD]April-17[/TD]
[TD]MZ[/TD]
[TD]200[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]April-17[/TD]
[TD]GB[/TD]
[TD]20[/TD]
[TD]18[/TD]
[/TR]
</tbody>[/TABLE]
worksheet 12 : 2018-03
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Importer[/TD]
[TD]Month[/TD]
[TD]Origin[/TD]
[TD]Mass[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]Importer 1[/TD]
[TD]March -17[/TD]
[TD]MZ[/TD]
[TD]300[/TD]
[TD]240[/TD]
[/TR]
[TR]
[TD]Importer 5[/TD]
[TD]March -17[/TD]
[TD]GB[/TD]
[TD]10[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]Importer 2[/TD]
[TD]March -17[/TD]
[TD]ZM[/TD]
[TD]60[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]March -17[/TD]
[TD]SY[/TD]
[TD]11[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
my workbook has 12 worksheets named by their moths. each worksheet has a number of rows that gets updated. please note that some fields of "Importer" are blank. for each worksheet I need to copy all mass values less than 20 and paste them to a new sheet called "under20", and transfer the rest to "over20".
your help will be much appreciated
worksheet 1 : 2017-04
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Importer[/TD]
[TD]Month[/TD]
[TD]Origin[/TD]
[TD]Mass[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]Importer 1[/TD]
[TD]April-17[/TD]
[TD]MZ[/TD]
[TD]100[/TD]
[TD]90[/TD]
[/TR]
[TR]
[TD]Importer 2[/TD]
[TD]April-17[/TD]
[TD]ZM[/TD]
[TD]50[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]Importer 3[/TD]
[TD]April-17[/TD]
[TD]IN[/TD]
[TD]20[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]Importer 1[/TD]
[TD]April-17[/TD]
[TD]MZ[/TD]
[TD]200[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]April-17[/TD]
[TD]GB[/TD]
[TD]20[/TD]
[TD]18[/TD]
[/TR]
</tbody>[/TABLE]
worksheet 12 : 2018-03
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Importer[/TD]
[TD]Month[/TD]
[TD]Origin[/TD]
[TD]Mass[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]Importer 1[/TD]
[TD]March -17[/TD]
[TD]MZ[/TD]
[TD]300[/TD]
[TD]240[/TD]
[/TR]
[TR]
[TD]Importer 5[/TD]
[TD]March -17[/TD]
[TD]GB[/TD]
[TD]10[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]Importer 2[/TD]
[TD]March -17[/TD]
[TD]ZM[/TD]
[TD]60[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]March -17[/TD]
[TD]SY[/TD]
[TD]11[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]