Macro recorder or programmed macros, a button expedition - scripting

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.

Related

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.

Advice for creating and scoring quizzes

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.

Dynamic Merging Cells in SSRS (usual answer doesn't apply)

I developed a dynamic Access report using "On Format" and "On Print" Event coding, and now I want to move over to SQL and SSRS, and I was wondering if there is ANY WAY at all, to capture the functionality offered in Access + VBA in SSRS. Frankly, I think it's absurd that this level of functionality is missing.
Reason being, previously I allowed users to merge text boxes in data entry by putting a "======" next to the column they want merged across, and the code would just extend the width across the "======" fields during printing.
Specifically, I have a Report with close to 20 text-boxes in each row, and any of them could be merged any which way in any random row, depending on where the users put the "======".
Meaning, if I would go the standard road of having many rows and just setting the visibility conditionally, I would need an enormous permutation of rows to capture all the possible merged cell layouts.
Currently, I am considering using RDCE, but I am not totally sure it will do what I need since the documentation is so scarce. Frankly, I am more wondering if there isn't some way to replicate the "on format" event coding in SSRS?
EDIT:Note, ultimately the goal would be to automatically generate their reports online, so is there some way of coding for events on the online rendering?

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.

Are there VB.NET UI Templates for Managing a DataSet?

Is there a quick and easy way to make a VB.NET user interface for managing the data in a normalized DataSet?
I know that is a very subjective question, so let me explain. For a brief period early in my career, I used to create user interfaces in Microsoft Access. I developed a simple, but very effective approach to user interface design. Here are some details of that approach:
Create one form per table. Put on
each form all controls necessary to
completely manage one row in the
table.
Use combo boxes for
foreign-key columns.
Give the user a
standard way to add rows and delete
rows.
Use Apply and Undo buttons.
Let
the user navigate from one row to
another with a list box.
Provide a
search box and filter options for
more efficient navigation.
Let the
user double-click on controls
representing foreign-key columns to
quickly navigate from one form to
another.
Make the state of each form
persistent (so the user always
returns to the last navigation point)
etc.
Simple, right? I found that Access encouraged this approach. It has many built-in features that make this kind of UI easy. For instance, creating a combo box to represent a foreign key relationship takes about 10 seconds.
Well, I haven't worked in Access for a while. A couple of years ago, however, I was hired to write an application in VB.NET on the NET 2.0 framework. To get a data management user interface up and running quickly, I used my Access experience to write a quick & easy prototype in Access -- that took me about one week. Then I hired a programmer to implement that same UI in VB.NET. What a nightmare! We've been working on that implementation for a year, and I'm still very unsatisfied with the results. Some of the problems we are having:
Apply and Undo buttons don't work quite right. We can't find an event that tells us when the form is "dirty" (thus making Apply and Undo relevant).
Navigation from row to row and from form to form requires surprisingly complicated code. I get the impression that we are fighting against NET's binding features, not working with them the way they were intended to be used.
The NET controls seem buggy. For instance, when the user types a value into a combo box (as opposed to choosing it from the drop down), it doesn't trigger the SelectedValueChanged event.
We seem to be repeating a lot of information. For instance, the DataSet knows there is a relationship between the columns in two tables, but we must nevertheless effectively repeat the details of that relationship when we program the combo boxes, binding, navigtation features, etc.
We still don't have good solutions for the filter and search features. There are lots of little details to work out. (For instance, what if you choose a filter that doesn't include the currently displayed row?)
We are writing many helper functions and classes to simplify the work, and I can't figure out why that effort hasn't already been done by others -- I'm certain we are reinventing the wheel.
etc.
By themselves, none of the above are a big deal -- there are effective solutions to each one. Taken together, however, these problems are making my UI development go much slower than expected.
In an ideal world, I should be able to create a small amount of code relevant to my specific data model (for instance, one user control per table establishing the layout and logic relevant to the rows in that table) then integrate that code into a template which interprets the data model and handles everything else -- navigation, adding and deleting, apply and undo, search and filter, etc.
Thus, my question: Is there anything out there which makes this type of UI development easier?
I've searched the web for various combinations of "generic forms", "UI templates", "data managment forms", etc., but I haven't found anything on topic. Perhaps I just don't know the buzzwords. Is there a specific name for this type of UI development task?
Create UCs for each table. Drop a grid control onto the UC and bind it to the tables dataset using VS's wizard. Select the options that allow for insert, update, delete. Each row on the grid will have those buttons/actions automatically added for you.