👉

Did you like how we did? Rate your experience!

Rated 4.5 out of 5 stars by our customers 561

Award-winning PDF software

review-platform review-platform review-platform review-platform review-platform

Video instructions and help with filling out and completing Form 2220 Toggle

Instructions and Help about Form 2220 Toggle

Welcome to part 12 of this tutorial series on Excel VBA userforms. This video is going to explain how to use toggle buttons. It's a fairly short video because toggle buttons are fairly straightforward. They are a lot like checkes in terms of the way they work. I will explain how you can draw a toggle button on the form and then how to change some of its basic properties. I will also explain how to write code that tests the value of a toggle button to different actions. Lastly, I will explain how to set the default value with the toggle button when the form first launches. So, there's not much to do but let's get started. Here's a quick example of a toggle button. This one lets the user choose whether the film they're adding into the list should be sorted by its ID number or by its title. When you click on the toggle button, it switches between sorting by title or by ID. Although they look quite different, they are functionally identical to a check. They have a true state and a false state. To start, I need to add an extra column of data to the worksheet. I'm going to pick column A for this and call it ID. I will then type in the numbers one, two, three, four, five, representing the current positions of the films in the list. This will help us get back to the original sort order when we start sorting by the title column. We also need to make sure that when a new film is added to the list by the form, it calculates the next ID number for the film as well. To do this, we need to go to the code behind the "Add to List"...