Howdy, not new to coding but new to VBA.
I have made a sample version of the data I'm working with below.
My goal is to create a function that will sum all values from the label 3 columns, given that they have the specified code. My current thought process for this is to take the Range (User Defined selection of cells. In this case a box from the top 20500 to the bottom right 6), the step (every 3 in this case), and the check value/ variable (20500 or 20000 in this case) and try to complete this using that.
My thoughts were to have a grand total that is added to as rows/columns are indexed through in a for loop but I haven't been able to make this work.
How should I go about this?
Thank you in advance!
I have made a sample version of the data I'm working with below.
Code | Label 1 | Label 2 | Label 3 | Label 1 | Label 2 | Label 3 | Label 1 | Label 2 | Label 3 |
20500 | 1 | 6 | 1 | ||||||
20000 | 2 | 5 | 2 | ||||||
20000 | 3 | 4 | 3 | ||||||
20500 | 4 | 3 | 4 | ||||||
20500 | 5 | 2 | 5 | ||||||
20000 | 6 | 1 | 6 |
My goal is to create a function that will sum all values from the label 3 columns, given that they have the specified code. My current thought process for this is to take the Range (User Defined selection of cells. In this case a box from the top 20500 to the bottom right 6), the step (every 3 in this case), and the check value/ variable (20500 or 20000 in this case) and try to complete this using that.
My thoughts were to have a grand total that is added to as rows/columns are indexed through in a for loop but I haven't been able to make this work.
How should I go about this?
Thank you in advance!