Chart range changing with Textbox input

yjung15

New Member
Joined
Apr 27, 2006
Messages
7
Hello,
I'd like to easily change the axis scale on a chart by inputting the value into a textbox, not directly into a cell.
This is because I'd like to cover the entire viewable page with the graph and would like to have a textbox floating over the chart so I can easily change the axis displayed without having to enter into the spreadsheet directly.

Trouble is, I tried using "textbox1_change()" routine, but this changes the axis scale immediate after 1 character is input into the textbox.
For example, I'd like to enter 100, but as soon as 1 is typed into the textbox the scale changes to "1", not waiting for me to press "enter" or anything.

Can any one help?

Thanks
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi there,

You could try AfterUpdate routin of TextBox1 Control. For example;

Code:
Private Sub TextBox1_AfterUpdate()
    Dim Point As Range
    Set Point = Sheets("Sheet1").[A1]
    Point = Val(TextBox1)
End Sub

I think this sample can solve your problem.
 
Upvote 0
Thank you for the suggestion.
I've given "AfterUpdate()" a try.

I seem to be missing a critical step. After typing "50" into the textbox, and pressing Enter, the value in cell A1 does not change to 50.

How is "AfterUpdate()" function triggered?
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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