How to print multiple iterations of the same sheet using VBA - excel

I have a one pager that I have built for work that pulls data for specific stores into a one page document. Area managers will have anywhere from 10-15 stores that they cover. I would like to write a macro that allows them to select their area, run the one pager for each store within their area, then essentially append that to a list of sheets to print. The result I am looking for is a 10 - 15 page document laying out the one pager for each of the managers stores.
I have done a decent amount of research and haven't been able to find anything to this effect. I am not asking for someone to write the code for me, I just need a high level overview of 1) if this task is even possible to automate, and 2) what resources to use to learn how to do it. I appreciate any help you may have to offer!

It should be possible to create a userform to select the specific region. From there a macro could run your one pager for each of the defined stores in that region and place each one pager in a new worksheet as it went through the list. At the end you would have one workbook with 10-15 sheets. You can then either print or export the entire workbook.
Is that in the ballpark of what you were looking for?

Related

Is there a way to change data entry on one sheet while on another sheet in excel (manual entry of the same data point in two locations)

I am building a financial model with 3 sections (Data Entry/Assumptions, Calculations, Reporting). The team is very excel heavy so my options around system automation are limited. In the data entry tab, junior team members would enter 100's of assumptions, calculation would take place in the background and management reporting would update. Management is going to want to be able to toggle a handful of those same assumptions from the reporting tab, as they are not going to go into the depths of the data entry.
Essentially, from the Reporting Tab & the Data Entry tab, users will need to be able to change the same cell. Is there a way to get a view into and be able to change the data on one tab while one a different tab? I thought that I saw an embedded window once where a different tab was represented, allowing the user to change that tab from another but I have not been able to find anything.
Ideally, the result would be the embedded window. I have considered forms but haven't dug into the functionality yet. I am not comfortable in VBA (defer to Power Query for automated data manipulation) but I am not opposed to a simplistic application. I am wondering if it makes sense to have the Junior team enter their assumptions and have a VBA enabled button overwrite that data with whatever is in the other tab once clicked by management - open to ideas.

Scenario manager: can you create scenarios in a table, and get the Scenario Manager to read from there?

Microsoft's official site has an explanation on how to use scenarios in Excel.
If you name the input cells, the scenario manager will show the name, so it's easier to remember that $C$5 is, say, the price.
My question is: is it possible to set up the scenarios in a table somewhere in Excel, and get the scenario manager to read from there? Setting multiple scenarios in the scenario manager is very fiddly, time-consuming and error-prone, especially when the inputs are linked - e.g. setting 10 scenarios where each scenario is an x% change from the previous.
Any suggestions?
PS I know all these things can be done very easily in a scripting language like Python or R, but in this very specific case the calculations are not too complex and the file needs to be shared with other people, so I must use Excel.
VBA would be a last resort because some of these people have VBA disabled by default.
Edit
To clarify, what I'd need is a way to create a table like this below, where those in blue are the inputs, and those in grey are the outputs. I have put together a banal example below, along the lines of the example in the VBA macro answer given below, but the general idea is:
define a number of scenario as the combination of multiple inputs (more than 2) ;
create a table showing, for each scenario, the inputs and some key outputs;
note the table doesn't have all the possible combinations of all the inputs, like the macro given in one of the examples - that would be too much and wouldn't be very readable.
I could put together a quick VBA script that changes the inputs in the model, reads the result and creates the table, but I was wondering if there is a better way - VBA is typically not very robust, in the sense that just changing the location of one cell can often mess things up. I usually avoid Excel for the more complex models (this would be banal in any scripting language), but this I have to do in Excel.
EDIT #2:
Trying to further clarify what I have in mind, I have put together the screenshot below. Each output is the result of many different calculations, and CANNOT be calculated as a small, simple formula - if it could, I would not have any issue, of course!
My issue is that:
- if I change an input, then all the many many calculations occurring behind the scenes change
- the outputs are read from all those calculations
- I cannot use two-way what-if tables
If even this is not clear, the only other thing I can try is to upload an Excel file, which is generally discouraged on SO.
Scenario Manager is a built in function with it's own GUI.
For this reason, the function will be limited in what it can call (only data entered in the GUI)
VBA will allow you to manipulate this data, telling it where to pull the changing values and what data to change it by
So the answer for your specific query:
Can I use Excel without VBA to perform Scenario Manager tasks not set by the GUI?
No.
But it doesn't mean fiddling with the Manger itself would be horrendous. There are ways to teach and learn with it, but also if you save a macro enabled document, users should be able to turn the macro on with the click of a button - so VBA can be an option too
I hope this helps?

Looking for guidance on VB Code for Excel that will create action between two dynamic tables in each sheet.

I am trying to create a spreadsheet that allows me to keep track of a customer with general details (name, phone number, address...) bu then also keep a very specific list of all the products they have ordered. I want to be able to run reports on frequency of all details including what has been ordered. I have a bit of programming experience but not a whole lot of Excel experience so I know how I would write a program but not exactly how to do it in Excel. My thought is to have one sheet dedicated to the general specifications of the customer and then a second sheet that keeps track of the orders per customer. I want to be able to click on a hyperlink or something of the sort that will take me to the second sheet and automatically fill in the customer name. I want the first sheet to have the guest information running horizontally in rows but then the second sheet would have the names running horizontally on the top row and the orders would go down each column under the names. This way it keeps all of my sheets tidy and allows for me to run the type of reports I'm looking for. The main issue I'm having is figuring out a way to create a link that will do the action I want. I understand how to program but don't know Visual Basic very well but if someone was able to offer a similar code I would be able to decipher it and change it to my needs. Or if someone has a more efficient thought on how to set up the spreadsheet I'm all ears! Thanks a ton!
what you need is to create a pivot table with a data model.
The instructions are longer then what it actually takes!
here are few tutorials about the subject:
youTube video
MSDN instructions
PS don't write code in Excel unless strictly necessary. If it's a data issue, use data model

Multiple user editing single Excel file using Single GUI

could anyone suggest a way multiple user can access single Excel file(Database) using Single userform. I have a system where multiple users have to update single excel file (Adding or deleting record). So could any of you suggest how should i proceed. I know this is an software process question rather than a software code question. But still asking, if Anybody could help me as i cannot find a feasible solution to do so.
When you have a network share available, would 'Shared Workbook' do the trick? (sounds a lot like it to me). You basically check a box that the workbook is from now on 'shared'. Excel will allow several users in parallel to open the same file for editing. It will make sure that everyones writes end up in the file (and that each save gives you others' edits).
You can find more info e.g. here: https://support.office.com/en-ie/article/About-the-shared-workbook-feature-49b833c0-873b-48d8-8bf2-c1c59a628534?ui=en-US&rs=en-IE&ad=IE
This may not be what you want, but you an have multiple users editing multiple files, but have the data combined into a single file. This will work as long as you have a fixed maximum number of data editors (say 20). Just create a simple data entry file with the userform built in that stores the data entered in a sheet. Now create 20 copies of this, one for each user, and store them in a file sharing environment like SharePoint or a shared network drive. Now you can have the master "database" file aggregate them into a single file by using workbook links.
In order to be able to do things with them as if they were a single data set, you need to do a sort of union of the data, which is not straightforward in Excel. Again, you need to establish a hard maximum size for each user to edit - for example, 5000 rows. On a Sheet in your database workbook, designate rows 2-5001 for the first user, then leave an empty row (usually I color it black to make it easy to spot), then 5002-10003 for the next user, etc. In Cell B2, put the formula
=if('J:\Network folder\[Data Entry 1.xlsm]DataSheet'!B2="","",'J:\Network folder\[Data Entry 1.xlsm]DataSheet'!B2)
and fill that to all the cells in that range (down to row 5001). Then repeat in the next range (B5002, for the second range:
=if('J:\Network folder\[Data Entry 2.xlsm]DataSheet'!B2="","",'J:\Network folder\[Data Entry 1.xlsm]DataSheet'!B2)

How can I change the data source per tab instead of for the entire workbook?

I am in the process of upgrading an excel spreadsheet we use to manage timecards with for employees every week, we use OCR to process them. Currently our big spreadsheet, its a multi-tabbed spreadsheet where every employee in a given department can see everyone else's time that gets logged.
What I am in the process of doing is making individual spreadsheets inside folders for each employee to access, these folders will be locked so employees of each department cant go in and see other peoples timecards. One master spreadsheet with the use of index/match will pull the data into the master spreadsheet.
I have one page completed for one employee but I have about 20+ more employees to go and it took 6 hours to do one page, is there a way that I can change the spreadsheet connection of one individual page instead of the entire workbook?
here is an illustration:
i have hundreds of cells on one tab connected to this external spreadsheet
With the use of the "Edit Links" prompt I am aware that I can change data sources, but I want to edit the connection per tab not the entire workbook
i want to have one tab pulling from one data source, and the next tab pulling from another data source. I want to accomplish this without going into each cell and updating the link and spending a 40 hour work week on something so small.
How can I do this?
thanks!
using replace all, [ctrl + h] for windows, you can change any value within formulas on the entire page
works great

Resources