I am in need of help with VBA and planning a workout Routine based on 71 different workout programs.
This is what I am wanting to do essentially in the order that I want it done in.
1. Read a set of inputs from a sheet that read: Program Name (Text), Ownership (Yes or No), Length (Number of Days), Type (Workout Type, ie Cardio, Martial Arts etc.), Difficulty (Beginner to Expert), Desirability (Is this I program I want to do, Scale of 1-5) and Completed (Yes or No). Found in Columns C:I
2. Using a points system with a value associated with each of the parameters (except Program Name) to create a value which prioritizes the workouts. I want this value stored in Column B
3. Then assign a priority number based on their value. The lowest value gets higher priority, duplicate values get the same priority. If ownership is No then there is no Value or Priority assigned color of cells in row change to Red. If completed the priority should go to 0 and color of cells in row change to green.
4. The data should automatically sort by Priority, then by Program Name
5. The Next step would be to randomly select a workout based on a weighted probability.
7. I then want this to repeat and schedule the next day randomly and store that in the next row so it will then read either Program 1: Day 2 or Program 2: Day 1 etc.
8. Every 7th random selection needs to be a Rest Day and the cell should say Rest Day
9. I want it to schedule 7 days at a time, so it would be 7 random workouts and a Rest Day
10. Lets say that Program 1 has a Length (from step 1) of 12 days
12. I do not want previous scheduled workouts to be removed from the schedule sheet. The next random program should be placed on the next row, for every program until all of them have been completed.
13. I plan on having a sheet that contains the workout program along with the workout for each day, which will be selected from a drop down. So it will read Program 1: Day 1 in column A and in column B it will read Legs etc. This is so that the Weekly Schedule Worksheet that I have will pull the Program 1ay 1 from the Schedule Worksheet along with the workout associated with that day. Those workouts will have time and equipment associated with them which will also be pulled into the weekly schedule.
14. All of this will happen each time a Schedule Button is pressed and it will schedule 1 week at a time.
I know that this is a complicated bit of programming and I would like to do the programming myself but have very little experience if someone would be willing to point me in the correct direction on syntax and what methods should be used for each task as well as check over my code that would be greatly appreciated.
I am currently in college, working 2 jobs, and am married with a 1 year old. This is for my second job which is as a self employed health and fitness coach. I really do not have the funds to pay someone to do this.
This is what I am wanting to do essentially in the order that I want it done in.
1. Read a set of inputs from a sheet that read: Program Name (Text), Ownership (Yes or No), Length (Number of Days), Type (Workout Type, ie Cardio, Martial Arts etc.), Difficulty (Beginner to Expert), Desirability (Is this I program I want to do, Scale of 1-5) and Completed (Yes or No). Found in Columns C:I
2. Using a points system with a value associated with each of the parameters (except Program Name) to create a value which prioritizes the workouts. I want this value stored in Column B
3. Then assign a priority number based on their value. The lowest value gets higher priority, duplicate values get the same priority. If ownership is No then there is no Value or Priority assigned color of cells in row change to Red. If completed the priority should go to 0 and color of cells in row change to green.
4. The data should automatically sort by Priority, then by Program Name
5. The Next step would be to randomly select a workout based on a weighted probability.
- Find the Unique Values for the Priorities since some of them get duplicated if there are duplicate values, and store in cells
- Count the number of occurrences of that Unique Value and store in cells
- Priority 1 occurs twice as often as Priority 2 which occurs twice as often as Priority 3 etc. and when multiple programs share the same priority then they divide the probability of that priority between them evenly. I believe the correct formula for this is (1/2^(Priority-1)*X)/Count, where the sum of all of the probabilities =100%. Store these in cells
- Using these calculated probabilities to then Randomly select a workout program from the list and store in a cell on the Schedule Worksheet
7. I then want this to repeat and schedule the next day randomly and store that in the next row so it will then read either Program 1: Day 2 or Program 2: Day 1 etc.
8. Every 7th random selection needs to be a Rest Day and the cell should say Rest Day
9. I want it to schedule 7 days at a time, so it would be 7 random workouts and a Rest Day
10. Lets say that Program 1 has a Length (from step 1) of 12 days
- Once a Program is scheduled for the same number of days as its Length, then the Completed parameter should switch to Completed, which then changes the priority to 0, which then removes this program from the probability calculation and adjusts the probabilities to account for 1 less workout
12. I do not want previous scheduled workouts to be removed from the schedule sheet. The next random program should be placed on the next row, for every program until all of them have been completed.
13. I plan on having a sheet that contains the workout program along with the workout for each day, which will be selected from a drop down. So it will read Program 1: Day 1 in column A and in column B it will read Legs etc. This is so that the Weekly Schedule Worksheet that I have will pull the Program 1ay 1 from the Schedule Worksheet along with the workout associated with that day. Those workouts will have time and equipment associated with them which will also be pulled into the weekly schedule.
14. All of this will happen each time a Schedule Button is pressed and it will schedule 1 week at a time.
I know that this is a complicated bit of programming and I would like to do the programming myself but have very little experience if someone would be willing to point me in the correct direction on syntax and what methods should be used for each task as well as check over my code that would be greatly appreciated.
I am currently in college, working 2 jobs, and am married with a 1 year old. This is for my second job which is as a self employed health and fitness coach. I really do not have the funds to pay someone to do this.