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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Erdinç E. Karaçam

Board Regular
Joined
Sep 23, 2006
Messages
202
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.
 

yjung15

New Member
Joined
Apr 27, 2006
Messages
7
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?
 

Forum statistics

Threads
1,176,447
Messages
5,903,157
Members
435,012
Latest member
Excel for life

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
Top