Results 1 to 6 of 6

Thread: *Resolved* Excel & "On SelectionChange" question

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2004
    Location
    Right here
    Posts
    275

    Resolved *Resolved* Excel & "On SelectionChange" question

    I have a query I am hoping you can help me with.

    I have an Excel chart and I want the user to be able to change to range of the x-axis to any number between 2 and 100. They do this simply by entering a number in a cell and the chart x-axis should automatically update so that the Max. Number for the x-axis equals the user input value.

    For the sake of argument suppose that the cell that the user needs to enter the number in is cell A1.

    I already have the code that changes the x-axis, which is as follows:

    Code:
    With ActiveSheet
            .ChartObjects("Chart 1").Chart.Axes(xlCategory).MaximumScale = Range("A1")
    End With
    The problem is I don't know how to get the spreadsheet to execute this piece of code. I thought that the SelectionChange event might be the one I need but I can't get it to work.

    Also, ideally I only want the spreadsheet to do anything if cell A1 only is changed i.e. it doesn't need to update the chart x-axis if some other cell is changed.

    So ideally I need code that says:

    Code:
    If Cell A1 is changed then make the x-axis of Chart 1 equal the new value
    Thanks in advance
    -Rob
    Last edited by TheRobster; Jul 10th, 2005 at 04:15 PM.
    http://www.sudsolutions.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width