ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   for each problem (https://www.excelbanter.com/excel-worksheet-functions/31634-each-problem.html)

mango

for each problem
 
Dear all,
How to use 'for each' statement or any other method if i want to copy data
from sheets to a summary sheet. following is the scenario.

I have sheets mat301, lab301, mat302, lab302, mat303, lab303, mat304,
lab304,...
Data from mat301 and lab301 will appear in line 1 in summary sheet, mat302
and lab302 data will be on second line, and so on so forth.
Cell position to copy to summary sheet are the same. which means cell
position for project no and project description in mat301 will be the same
for other mat999 sheets. only value difference. cell position for labour cost
in lab301 will be the same for other lab999. only value difference.

Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets

Format in summary sheet
proj no proj desc cost
1 prj301 this is prj301 450
2 prj302 this is prj302 6740
3 prj303 this is prj303 510

Please help. thanks

JPW

You're in the wrong group for this. :) In any case, we need more
information. I'd suggest sending the file to my e-mail (delete REMOVE from
the address before sending) and I'll make the modifications for you and send
it back. Please be aware of any policies your organization may have against
releasing confidential information before doing this.

"mango" wrote in message
...
Dear all,
How to use 'for each' statement or any other method if i want to copy data
from sheets to a summary sheet. following is the scenario.

I have sheets mat301, lab301, mat302, lab302, mat303, lab303, mat304,
lab304,...
Data from mat301 and lab301 will appear in line 1 in summary sheet, mat302
and lab302 data will be on second line, and so on so forth.
Cell position to copy to summary sheet are the same. which means cell
position for project no and project description in mat301 will be the same
for other mat999 sheets. only value difference. cell position for labour
cost
in lab301 will be the same for other lab999. only value difference.

Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets

Format in summary sheet
proj no proj desc cost
1 prj301 this is prj301 450
2 prj302 this is prj302 6740
3 prj303 this is prj303 510

Please help. thanks





All times are GMT +1. The time now is 05:59 AM.

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