0

I have a master reference sheet that has information for the top x customers. This file has x columns of data (such as address and priority), and x rows. This "master reference sheet" is Tab 1 in my Excel Workbook, let's call the workbook Customers. "Data" (Tab 2) in Customers contains data in accordance with each in Tab 1.

I have a VBA script that creates a new tab for each of the top x customers, uses all values in column y associated with each customer in "master reference sheet", searches for it in "Data", and returns all rows associated with said values. (This part is not that important, just know that I create new tabs for customers).

However, I receive a new "Data" tab nearly every day, which is in a different Excel workbook (Daily_Data). My question is the following: Can I run my VBA script, which is associated with the "Customers" workbook (which will contain only "master reference sheet" tab), on a separate Excel Workbook (which will contain only "Data" tab), and generate the tabs in the workbook containing the "Data" tab?

I do not want to copy and paste code at all. I want to run this VBA script every day without typing anything. The file I want to run the VBA script on (file containing "Data" tab) will have the same name every day (Daily_Data). I will have both Customers and Daily_Data open at the same time. I want to be able to click "Run Macro" from Customers, and generate these tabs in Daily_Data. I'm assuming this is fairly easy, but what is the best way to run code on a different Excel workbook?

I actually answered my own question. This question would have been difficult to answer properly without seeing my code anyways. Thank you.

2
  • I figured it out. My apologies. Commented Aug 10, 2015 at 14:36
  • 1
    You can delete this question if you have answered it. Commented Aug 10, 2015 at 14:39

1 Answer 1

0

It was a simple solution. I can just access a separate workbook using Workbooks("Daily_Data.xls").Sheets("daily_data").

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.