I have some problems with Active X buttons in VBA.I have a spreadsheet with Active X buttons in D,E,J columns which executes some calculations based on A,C columns values.
I have 2 Active X buttons in 1st row too - 1st button ('Clear Last Input Row') clears values from last inputed row ( only C,F,G,H,I,K,L col) and 2nd one ('Clear All') clears all value from C,F,G,H,I,K,L columns.
I have some issues with these last 2 buttons - If I input in C col in row 5th , 12th, 24th, 37th in that order (that's when workbook is open for 1st time) and then click on D or E or J buttons calculations are made in F,G,H,I,L .
Then if I click 'Clear Last Input Row' 37th row values are cleared,but if input new value in C to calculate - for example in 49th row then D and E buttons don't execute calculations as I wish - and they are - calculations in same row + add values from previous row - which is 24th row (by the way F and G columns calculate values in row + add values from previous row and H and I columns have to show distance between last input row and first row (49th and 5th) and distance between last row and previous input row (49th and 24th). But calculations in that 49th row are only in the same row and not add these values from 24th row in F and G columns and col I shows distance between 49th and already cleared - 37th row.
When I click 'Clear All' all values are cleared but when I input a row then H and I columns measures distance from last already cleared row from previous session.
What might be wrong with VBA code?
I have 2 Active X buttons in 1st row too - 1st button ('Clear Last Input Row') clears values from last inputed row ( only C,F,G,H,I,K,L col) and 2nd one ('Clear All') clears all value from C,F,G,H,I,K,L columns.
I have some issues with these last 2 buttons - If I input in C col in row 5th , 12th, 24th, 37th in that order (that's when workbook is open for 1st time) and then click on D or E or J buttons calculations are made in F,G,H,I,L .
Then if I click 'Clear Last Input Row' 37th row values are cleared,but if input new value in C to calculate - for example in 49th row then D and E buttons don't execute calculations as I wish - and they are - calculations in same row + add values from previous row - which is 24th row (by the way F and G columns calculate values in row + add values from previous row and H and I columns have to show distance between last input row and first row (49th and 5th) and distance between last row and previous input row (49th and 24th). But calculations in that 49th row are only in the same row and not add these values from 24th row in F and G columns and col I shows distance between 49th and already cleared - 37th row.
When I click 'Clear All' all values are cleared but when I input a row then H and I columns measures distance from last already cleared row from previous session.
What might be wrong with VBA code?