Intuitive auto-population of data between two worksheets - vba

I have two excel tables. One is a list of names with a calendar that tracks number of days traveled and puts it in percentage. The other table shows proposed travel schedules for the same list of people but in a different format. I have to manually find their percentage in table 1 and input them to the second table for presentations. I want to develop something that reads the names in both tables and can copy their travel time percentage into the second chart. Maybe adding it in the cell or to a blank row below. I have been unable to find any previous threads relating to this. I am new to programing and do not know if this can be done in VBA macro for excel. Does anyone know what functions I could use to accomplish this?

The quickest way is to use powerpivot. You'll have to look at your version of excel to see how to access it. For instance, powerpivot is included and preset in excel 2016, and is a free add-on you'll need to download for excel 2010.
You can uplaod both those tables into the powerpivot model, define the relationship between the two tables (as simple as dragging the relationships in a diagram view). Then you literally have a pivot table that connects both and you can create a measure that does what you're saying. The plus is that there's so much more you can do!
Hearing how your data is set up if you run through a powerpivot table tutorial you might even rethink your data set-up. The advantage is you don't need to learn vba just learn to apply your current and new excel skills. A good starting point is here:
https://msdn.microsoft.com/en-us/library/gg413497(v=sql.110).aspx
There are also 5 min youtube clips that'll give you a good idea of what else you can do with it.

Related

How can I access data that changes locations and header names across workbooks?

I am trying to access data that changes locations and header names across different workbooks. This is part of a bigger project but this is the only part I cannot figure out. I have attached images to help clarify what I mean. Let's say that I'm trying to access the range that contains the Net Worth/Balance so I can do some calculations with it. How do I do this if the headers change across dozens of workbooks? On top of that the headers aren't always the first rows with any writing on it. Sometimes there is info in the upper rows that are needed for the workbook but not my purpose.
The programmer in me wants to use a dictionary and find all variations of the "Net Worth" title that exist but is that the most efficient way? Should I just use a super long if then statement?
Thanks in advance for your help!
****Also if anyone is wondering if I should even use a macro for this please remember this is part of a much larger project where there are many calculations and they are repetitive across workbooks. My only difficulty is finding where the data is in each workbook.

Exporting/copying data from PDF to Excel and aligning the columns and rows together

In real estate, I usually have to manually write each tenant and their information into our models. We usually get PDFs and not excel spreadsheets. There are two problems that happens a lot if I try to export PDF using Adobe standard. Photo 1 is where I hold CTRL and copied everything over, except I have to manually move over the data into the same column then I concatenate the data so I can then finish by copy pasting it into my spreadsheet.
The other way is using the exported PDF data and manually working around it. When there's 50 tenants, it can take me all day.
Does anyone have solutions I can use? I feel like i'm wasting so much time. Any VBA solutions or creative exporting solutions using adobe standard?
In the end, I need a column for Tenant Names, the square footage, the base rent, the rent per SF, the lease start date, end date. As you can see, the data gets thrown all over the place.

Looking to build a lineup builder for the site draftkings using excel

Why excel? Well excel is what is used to import the player salaries.
Now I need the spreadsheet to do the following.
Create teams within salary cap.
Include/exclude specific player function
Build multiple lineups from a selected list of players within the cap
Can I do all of this with excel? or do I need to know excel vba as well?
Also which parts of excel or if necessary excel vba must I need to know to code such a thing? Also if someone could give me a short summary of the steps needed to hypothetically make such a thing it would be great. Thanks.
I'm posting this as a reply because it is too long for a comment window.
Just because Excel has a grid doesn't mean that it is fit for data storage and data handling, on the contrary.
What you typically want to do is create a transparent structure that guarantees the integrity of your data and that allows dynamic portability when needed one day.
Excel is meant to be a spreadsheet, people forget this all the time or they just avoid the topic: although Excel has a grid, doesn't mean that it is a good fit for reliable data storage. It is not even the least complex way of storing data, depending on the amount of VBA that you need to manage all these data and the gates that you unnecessarily open towards potential bugs.
This is why an RDBMS is what will fit your needs, in this case Access would be a good option as it preserves your data integrity if you get the table structure right and it executes a lot of tasks for you that you should otherwise need to program yourself to protect the integrity of your data.
Although you can perform SQL on spreadsheets too, note that Excel does NOT cover related tables (what you typically seem to need for building your teams and salary limits), so what many Excel programmers will typically do is to create their own code to make this cross-table data storage thing work.
Don't do this if the alternative is available and much more reliable and future-proof.
At first sight, it seems that you won't even need any VBA; I'm not sure of all the things you want to do, but my first impression is that you can manage everything with SQL syntax and stored queries in MS Access. You can import Excel sheets into Access if you get their format right so that should not be a problem.
Once your data is stored there, rest assured that you have made your life a lot easier.

Is there a way to run excel code in sql or run small datasets in excel and export to SQL automatically?

I'm perfectly happy with excel; I know the codes and I find the interface very intuitive. The only problem I have now is that I have lots of formulas in several columns, which are linked to other excel files and am tracking sales over time. Currently I have 1500+ rows of data and sometimes Excel has trouble to calculate all the necessary codes and I need a way to make sure that into the future, when there are 10000+ or more rows, it is possible to run the code without Excel stopping/freezing. My boss says using SQL should help. However, I am unfamiliar with it and know that excel and SQL can be used similarly.
Ultimately, I want to know if I can run the excel code in SQL or if I can calculate small datasets (sets that are pulled periodically) in excel and them export to SQL automatically instead of having to go through the wizard for importing data. Also, I would need to attach the small datasets into the large one. Any ideas other than just learning SQL? This needs to be accessible to many people who don't know SQL so simply learning SQL isn't too helpful.
If you're familiar with Excel and its formulas, it won't be too arduous for you to pick up on SQL. In addition to that, I can copy and paste outputs from SQL Sever into Excel sheets that have a graph auto-built (since I use Express) and it's a simple copy-and-paste into an Excel sheet.
While I don't know all your calculations, I haven't seen Excel be able to do something that SQL couldn't do and when you consider the benefit of indexing among the freedom to organize your data how you want (and have saved stored procedures), a switch might only be temporarily inconvenient while you pick up on SQL, and after that, you'll easily produce what you need.
Ultimately, I want to know if I can run the excel code in SQL
Not always exactly identical, but you can run similar structured code. For instance:
SELECT AVG(Sales) "AverageSales"
FROM Sales
VERSUS
=AVERAGE(A2:A2000)
or
SELECT (((DollarToday - DollarYesterday)/DollarYesterday)*100) AS "DollarDelta"
FROM USD
VERSUS
=(((A2-A1)/A1)*100)

MS Access: Add data to Chart programatically from Visual Basic

I'm looking someone who can help me with this issue, that seems very easy to achieve but there is no much information around the internet.
I'm working with MS Access and Visual Basic, and I would like to create a simple bar graph, giving params that I've already gathered from many querys.
In this case: A chart about Litres per Week. I have a query to gather the amount of litres of 4 different weeks. I also provide the information for the X Axis (Last week, Last two weeks, and so on.. ). It would look like this:
So I'm wondering if this can be done, as well a pie charts and line charts.
I'm aware that this can be easilly done with Excel, but I don't want open another program to read information.
Thank you very much.
How to make Charts in MS Access would be my first key word search :)
Then I will check on MSDN for proper tools/properties availability/updates on software and so on.
Here is a simple basic tutorial to follow
This is the entire google search that would provide you anything you want to check on the topic.
Please note the version of MS Access you are using against the tutorials described. In certain versions there are certain changes have been done to the software itself. You are much lucky if it's not 2007...
EDIT Based on the comments with OP:
Since OP has exhaustive/heavy queries, it's recommended to create a temp table based on the final query.
Then temp table can act as a view and become the data source for the Chart
dynamic binding of chart from database in VS2010 in C#
Bind query as a datasource to MS Access chart. There is a method called databindtable which is a chart property. You may use it:
e.g. chart1.DataBindTable(yoursource,columname)
This article provies a good sample code.