Finding and copying worksheets to active workbook

Still learning VBA

New Member
Joined
Sep 7, 2011
Messages
1
Hello MrExcel,

I am fairly new to VBA and its all functionalities, so I wonder if you guys can help me out a little.

Every month I receive an Excelsheet containing raw data which is divided over several worksheets. To be precise it contains exactly one worksheet per item and the data within each worksheet is identically organized.

I created a masterfile to which part of the raw data should be copied (I'll come to this in a minute). I have put together some code which opens the raw data file and there it stops for now ;) I have been looking around for code to do the job, but couldn't find the right thing so far. So that's why I am turning to you.

There are three things I would like the script to perform:

1. I have a list with the precise names of the worksheets, so I would like the script to use these names to go to each worksheet and
2. copy three columns (A, C and E) to the masterfile and
3. Furthermore (to complicate things a little more) I would like the script to copy only those lines for which column C contains a value.

I hope this gives a clear enough idea of what i am trying to do.

Any help would be much appreciated, thank you :)
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
1. I have a list with the precise names of the worksheets, so I would like the script to use these names to go to each worksheet and
what is the name of this sheet?
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,716
Members
452,939
Latest member
WCrawford

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