LearnVBA83
Board Regular
- Joined
- Dec 1, 2016
- Messages
- 113
- Office Version
- 365
- Platform
- Windows
Hi all you VBA Super Heros!
I finally got back into a role where i use Excel heavily and boy have i lost a lot of skills. I'm trying to automate a couple items and have a couple questions that I will post threads about!
Step 1: If i have a workbook with a bunch of worksheets that can change each month like the one in the attached image... Is it possible for VBA to loop through each worksheet and copy and paste the data into a new worksheet (so that all data is in one worksheet)? Here's the hard part! I only want the Loop to go through the worksheets with the 6 digit numbers in the name (so it would even pick up the one called 296135-GSO Ramp b/c the 6 digit number is in the name). I also want it to copy the name of the worksheet (only the 6 digit numbers) and paste it in each row in column A where there is something in column B of the file...
Image A: Shows what it would look like before the Macro
Image B: Shows what it would look like after the macro added the worksheet name
Then it would paste the data in a new worksheet, loop to the next tab that has the 6 numbers in the name and add the 6 digit number in column A where there is data in column C, copy paste to the new worksheet, and loop loop loop until down.
At the end i would have a new workbook or new worksheet that had all those tabs pasted into one worksheet and the tab name (6 digit number) in column A so you can see the change in worksheets
I finally got back into a role where i use Excel heavily and boy have i lost a lot of skills. I'm trying to automate a couple items and have a couple questions that I will post threads about!
Step 1: If i have a workbook with a bunch of worksheets that can change each month like the one in the attached image... Is it possible for VBA to loop through each worksheet and copy and paste the data into a new worksheet (so that all data is in one worksheet)? Here's the hard part! I only want the Loop to go through the worksheets with the 6 digit numbers in the name (so it would even pick up the one called 296135-GSO Ramp b/c the 6 digit number is in the name). I also want it to copy the name of the worksheet (only the 6 digit numbers) and paste it in each row in column A where there is something in column B of the file...
Image A: Shows what it would look like before the Macro
Image B: Shows what it would look like after the macro added the worksheet name
Then it would paste the data in a new worksheet, loop to the next tab that has the 6 numbers in the name and add the 6 digit number in column A where there is data in column C, copy paste to the new worksheet, and loop loop loop until down.
At the end i would have a new workbook or new worksheet that had all those tabs pasted into one worksheet and the tab name (6 digit number) in column A so you can see the change in worksheets