Question: VBA Excel Code Open the file Sort and Shade Protected.xlsm Download Sort and Shade Protected.xlsm. I want you to mimic this with your own code,
VBA Excel Code
Open the file Sort and Shade Protected.xlsm Download Sort and Shade Protected.xlsm. I want you to mimic this with your own code, which should work with any data set that starts in cell A1 and has column headings in row 1. Specifically, the user form should allow a user to choose any of the variables (including the index in column A) in the data set. Then it should sort on this variable. Finally, it should shade every other value of the chosen variable (when the variable value changes the shade changes), as you can see by trying it out a few times. (Record a macro to see how to set the interior of a cell to a gray theme color and how to remove the color background from a cell.) The file Sort and Shade.xlsx Download Sort and Shade.xlsxcontains some data you can work with, but your macro should work for any data set structured this way. Make sure your macro works with a variable that has an even number of values (like Children) and with a variable that has an odd number of values (like Opinion).
Information on the file -> Columns A-G are Index, Age, Gender, State, Children, Salary, Opinion in that order
The button must allow us to scroll through the columns and, choose a column to sort and shade, and then when we click the button again, should be able to erase the shading and start over.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
