Update formula on activation of scrollbar

jeffreybrown

Well-known Member
Joined
Jul 28, 2004
Messages
5,152
I have a Sroll Bar(Form Control) on a worksheet which controls the dataset for a chart.

Is there a way to insert a formula in a particular cell when the user activates the scroll bar, but only on the first time they use the scroll bar?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Unfortunately (even with a linked cell designated) changing a Forms scrollbox does not fire an event.

With a controls toolbar try

Code:
Private Sub ScrollBar1_Change()
'your stuff here
End Sub
 
Upvote 0
You could use an if statement to check if there is a formula in that cell, and if not, add one:

Code:
Sub ScrollBar()
    If [a3].Formula = "" Then [a3].Formula = "=A1*2"
End Sub
 
Upvote 0
Thanks CWatts,

This sounds good, but I need the cell to update when the user activates the scroll bar. I've changed to the contols scroll bar as Peter suggested.
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,626
Members
452,933
Latest member
patv

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