Hi everybody, I would kindly ask for your help regarding the advanced VBA function.
Scenario:
Range of cells E:T contains numbers. I would need a VBA function to search for a cell with a negative value. Once the negative cell is found, a value of the cell should be added to an adjacent cell on the right, then original negative cell content deleted. Repeat procedure until a value is positive or reaches column T.
i.e. Negative cell is E8 with value -100
step 1 - add value -100 to cell F8 with value 50
step 2 - delete value in E8
step 3 - repeat from F8 until final result is positive
There are multiple sheets in a workbook, ideally macro would loop through all of them with the same procedure.
Note: - minus number will show up always in the same column throughout all of the sheets (same column, not row!). Column with minus changes dynamically based other criteria.
Example sheet can be downloaded from link: example_minus_vba.xlsx
Thank you all
Scenario:
Range of cells E:T contains numbers. I would need a VBA function to search for a cell with a negative value. Once the negative cell is found, a value of the cell should be added to an adjacent cell on the right, then original negative cell content deleted. Repeat procedure until a value is positive or reaches column T.
i.e. Negative cell is E8 with value -100
step 1 - add value -100 to cell F8 with value 50
step 2 - delete value in E8
step 3 - repeat from F8 until final result is positive
There are multiple sheets in a workbook, ideally macro would loop through all of them with the same procedure.
Note: - minus number will show up always in the same column throughout all of the sheets (same column, not row!). Column with minus changes dynamically based other criteria.
Example sheet can be downloaded from link: example_minus_vba.xlsx
Thank you all