I need help with Active X buttons in VBA...

angel44e

New Member
Joined
Nov 15, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
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?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
If you cross-post, you must provide links (here and elsewhere).
 
Upvote 0
I couldn't 'Mark as solution' button cause I try till now to correct wrong calculations with help only from ChatGPT and still no human suggestions.
 
Upvote 0

Forum statistics

Threads
1,223,727
Messages
6,174,146
Members
452,547
Latest member
Schilling

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top