I created an excel workbook to track inventory for a project that my wife is working on. It does a ton of useful things for her but I have so many other good ideas for it to do more. It has gained some attention from some of her friends and I would really like to share it with them but keep everything locked so that they cannot accidentally mess anything up. With that said, I want to keep developing it as I come up with improvements.
My question is, does anyone know a way that I can basically release versions of an excel just like a a code upgrade? I want to be able to pass this thing along and then when I make some improvements I can release them but nobody loses any data or has to copy and paste data. Would this be something I could accomplish with VBA? anyone have any thoughts?
I had a similar problem a few years ago.
I ended up using two VBA macros to automate data migration from the old version of the workbook to the new version. Here are the high level steps:
Step 1:
Lock all of the cells except the inputs and options to the model so that you know where each piece of data is located (named ranges are helpful here).
Step 2:
Write a VBA macro to scrape the values out of the unlocked cells and save them into a CSV with a particular format.
Step 3:
Write another macro to load in the CSV you created in step 2 and fill those values in to the input cells.
Step 4:
Add in a few buttons to your workbook so that your users can easily access both macros.
When your users want to upgrade from one version to the next they will export their data from the old workbook into the CSV and import it to the new workbook. There are more elegant solutions but in my opinion they aren't worth the extra effort to implement and maintain.
Depending on what you're doing Google Sheets could be a good alternative too!
Apps can be easily updated because most of them have separate files for data, settings, user interface and functionality. In Excel usually all of that is combined in only one file, so it is very hard to separate them and update only the functionality without affecting the data. If you can figure out how to store the data in separate files, then updating would be easier.
Related
I am not proficient in either macro scripting in excel or scripting in general. I have a general sense of syntax and language formatting so I'm not necessarily going in empty handed with trying to program my owns scripts and I'm leaning this way due to the unique scenario I will be using the spreadsheet.
Essentially I'm wanting to track some data pertaining to slots for a pet project. What I desire is a "start" button that prompts which column I would like my "session" to start in, moves the selected cell to that column and prompts for a starting balance and fills it into the appropriate column; then there are a choice of buttons from which one that pertains to each of my bet options (there are 4) and that will fill in a column net to my balance with the appropriate amount as well as update the balance column to the next row. Lastly I would like to have 6(button) options for certain indicators I would like to track.
All of this I would like to run off of keyboard hotkeys if possible. Ultimately I'm mainly asking for resources since most of the "tutorials" show how to make a button, and some sense of hello world macros, but I'm mainly needing to find page navigation macros, input, take existing data, and append or modify that data with current variables.
-Thank You for any advice or resources and for your guys' time :D
I'm currently trying macro recording but it seems a little but specific to copy pasta situations and not so much the calculation, though small, but redundant that I could optimize with better scripting. I'm also finding that most of the buttons output to a text document outside of libre calc.
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.
I'm not sure where to actually post this (I'm pretty sure someone will chastize me tell me where after of course voting me down - expected).
I've been developing a bunch of files for Safety Training at my facility. The UI is built in Excel with Excel VBA at it's heart to get names and the Training program to run. The Excel file opens A PowerPoint presentation after getting your name and the program you desire and logs that data. When you are done with the presentation it opens as a Word doc - the quiz for that presentation.
My issue is this: currently all of our tests are created in Word (I barely know Word VBA) and would like to continue by just adding some text boxes and check boxes for the answers. I'd like to add some code to facilitate the automatic scoring of these tests by placing a button at the end that "locks" the test (so they can't change answers) then checks and returns the test score.
I don't see where Word Files can be locked as in Excel's "Protect Sheet". The scoring I am using seems to be flawed but that is an issue I can work out later if I stay with Word. I am wondering if it wouldn't be better and maybe easier to do this in Excel as it is set up more for evaluating data input.
Looking for any advice on what others might do if they had a choice to use Word or Excel for creating tests. I currently have no preference (except for the above - which I am not locked into) in which format to use, possibly even using a separate PowerPoint Presentation as the test itself.
To try to answer the question: What you are doing seems like a lot of fun from a VBA perspective, and from a user interface perspective, but it seems to me your intuition is telling you to move the test to excel and I think that is the right thing to do. You have much more ability to lock down the test, could easily score multiple tests and create a multi-test curve, etc, etc.
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.
I am trying to perform an operation that might be quite simple really, but since I don't have experience in doing this prior to this point, I may be missing something.
I have an Excel file that needs to be imported into a data table in Visual Basic (.NET 2010). Now, I am trying to import as a data-table, so that I can have the data flexible and ready to be used as and how I wanted to.
The Excel spreadsheet doesn't exactly have the most promising and worthwhile formatting, which makes this situation a tad-bit difficult. The column headers are not on the first row itself, but are on the 5th row and this might not always be the case. The column headers might even end up on the 10th row or even the first row - Any help on this would be great too.
The name of the worksheet can also be different, since I don't have any control over the end users that will be using the application. Any suggestions or code-help here please?
You will need to deal with the formatting issues to have true success. A consistent input is the only way to secure consistent output. Otherwise, you will need to build an interface that allows your users to map fields as they go.
Once you have that taken care of, I suggest using the OpenXML SDK to import your values ( http://msdn.microsoft.com/en-us/library/office/hh298534.aspx )