Advice for creating and scoring quizzes - vba

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.

Related

Macro recorder or programmed macros, a button expedition

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.

Is there a way of inserting a flow chart into a word document using access vba?

I am trying to insert a 3D flow chart into a word document using VBA, I have been asked to do this and I have no idea how to do this even after some research.
Sorry I have no code examples because I am at a loss on how to do this, and could probably misleading if I posted any :-)
Any help or direction would be greatly appreciated.
Mark
It is possible to use vba across different programs but adds a bit more complexity - added to which vba uses different objects and methods depending which program you're in.
Your best bet is to record as much of the macro as you can inside MS word, then edit the vba and transfer it to MS Access (I assume you'll be working with variables from the MS Access file or VBProject anyway).
This post would be an excellent starting point - yes, it's made for use in Excel, but the Word Object Model is used the same way.

Turn off Pivot Table Quick Explore in Excel

I'm hoping this is a stupid question with a simple answer.. as above, is there anyway to turn off the "Quick Explore" function in Excel. This appears when you select an item in a pivot table and click ctrl.
The problems are two fold:
My pivot is stragically placed and nicely (in my opinion) designed, and destroying the worksheet with newly placed filters causes a huge headache.
I have procedures that run on selection change spefically to assist when selecting the pivot table that also get decimated when selecting the troublesome Quick Explore
The biggest problem occurs when you're in a VBA window. If you're typing away and press Ctrl a couple of times - as I often do to get to a point in my code more quickly (ctrl+right for example) the explore tab appears despite not even being in the Excel window. Coupled with the fact that when you press enter the Quick Explore is triggered destroying the entire worksheet with it's nonsense. Not good when you've not saved in a while. Not good when I'm not even in an Excel window (infuriating some might say).
The "undo" on quick explore is just Excel's undo. Great for ease of use, but with no actual manual way of un-performing this abomination if undo is greyed out (perhaps my selection change code resets it, perhaps it is the Data Model undo limitations).
I've added my reasoning for the question in case anyone else is having the same problems with this quite ridiculous "in-place" drilldown feature. I understand the benefits of the drill-down, but I also understand the benefits of having a well-presented, readable report that doesn't require it and would like to turn it off!
Thanks in advance anyone.

Updating an Excel like a mobile app

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.

Count frequency of words in a list

I start by saying that I am not an expert user of VBA; I am just learning it.
I have a question regarding the possibility of counting text strings in Excel using a Macro. I cannot use the 'Countif' function, as there are more than 20,000 text strings in the Excel file, and it would be a lengthy procedure I guess.
I was therefore thinking about the possibility of using a VBA code to scan and organize text strings by their frequencies.
For instance, there are a set of words like this in my file (each in a different cell):
home,
balcony,
flat,
apartment,
home,
home,
garden,
thing,
revenue,
flat,
...
window
I would like to know if there's a way to make Excel scan all the different text strings and come back with the frequency for each of them.
I am aware that probably there are easier way to do it (e.g. Python or some add ins), but we have to do it at work, and I can't really ask my colleagues to learn Python or other programming languages, nor we have the capability to buy any software at the moment.
Thanks to those who can help!
Simple Pivot Table (without VBA - but could be code if needed)
See Debra's great website