Hi,
I am looking for VBA code to solve a current problem.
I have a list of numerical (row) values (Column A) that I am sorting the column (by VBA code) in descending order. Column B is the Bin location. These rows are then output to another worksheet (Column 1 shows the amount and Column 2 displays the Bin location and the amount to be shipped from each Bin). After each output, the original (A & B) columns are re-sorted.
If
Column A = 27
Column B = Bin1
Then
The Output should be
Column 1 = 27
Column 2 = Bin1 27;
written as
Firstly, I need to evaluate each cell value against a specified threshold amount (in this example it is 27)
I have included parts 1 & 2 to provide background. But it is part 3 that I need to solve.
1. Where the cell value is greater than the specified value
If the cell value is greater than the Threshold amount, then I write 27 to the other sheet and replace the cell value with the remainder.
For example:
A B
Firstly,
1 2
is written to the additional worksheet
The column is again sorted in descending order and then the column list becomes:
Then another
is written to the additional worksheet
The column is again sorted in descending order and then the column list becomes:
2. Where the cell value is equal to the specified value
If the Cell value equals the specified amount, then 27 is written to the additional worksheet and the existing row is deleted
For example:
Where
is output to the additional worksheet
The column is again sorted in descending order and then the column list becomes:
3. Where the cell value is less than the specified value
If the 1st Cell value is less than the specified amount (remember they have been sorted), then I need to calculate each row and determine whether multiple values are equal to the specified amount and output the combined amount.
For example:
Where
is written to the output file
The column is again sorted in descending order and then the column list becomes:
And then
Leaving
Which is finally output as
The complete output for section 3 should look like this:
Question
How do I perform section 3 - Where the cell value is less than the specified value?
Thanks in advance,