ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Merging worksheet - ideas (https://www.excelbanter.com/excel-programming/347656-merging-worksheet-ideas.html)

mortals

Merging worksheet - ideas
 
Hi guys,


I'm back with a somewhat simple yet complicated problem. I have 2
separate worksheets with different headers but corresponding columns
that I need to merge. They would look something like this.


Sheet1
Part
Description
Last Use
Last Purchase Order
Buyer


Sheet2
Part
Price
Quoted Price
Last Use
Buyer


The corresponding columns that I want are Part, Last Use and Buyer


I've been trying to figure out how to merge these 2 worksheets and can
only come up with a really bad pseudo code for it. =/


Copy entire sheet1 onto sheet3
Delete unwanted column


while loop to count number of rows occupied on sheet3 (Dim x as long)


another while loop with Dim y as long, y=2 for sheet2
x+1
while sheet2!Ay is not null,
sheet3Ax = sheet2!Ay


Thats the best I can come up with. =/ Seems a little troublesome. Can
anyone come up with a better solution?


*Note* I can do a while loop in the beginning to copy over only the
columns I want as well and that will pretty much take the place of the
counting loop/

Thanks in advance


-Simon



All times are GMT +1. The time now is 11:43 PM.

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