+ Reply to Thread
Results 1 to 2 of 2

plot x, y graph with cells

  1. #1
    Forum Contributor
    Join Date
    08-08-2006
    Posts
    203

    plot x, y graph with cells

    I have a sheet with values in "X" values in A2:A300 and "Y" values in B1-CC1. I would like to have an inputbox to input the x, y value and have the corresponding cell selected.

    Example:
    Input- .20, 2.25
    Result- Cell E7 is selected
    Please Login or Register  to view this content.
    What would be even better is if the inputbox would round up or down if the numbers input were not exactly the same as the ones listed. But if thats not possible I would be happy with just a solution to the top one.

    Example:
    Input- .215, 2.247
    Result- Cell E7 is selected
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    03-16-2004
    Location
    UK
    MS-Off Ver
    2003
    Posts
    85
    Try something like this....

    Sub Test()

    x = InputBox("Enter x", "X Value", 0)
    y = InputBox("Enter y", "Y Value", 0)

    x = x * 2
    x = Round(x, 1)
    x = x/2
    x=x*4
    y = Round(y, 0)
    x=x/4

    For Each c In Range("A2:A300")
    If c.Value = x Then n = c.Row
    Next c

    For Each c In Range("B1:CC1")
    If c.Value = y Then m = c.Column

    Cells(n, m).Select

    End Sub

    I think I worked it if you, multiply by 4, then round the number and then divide by 4 it should make sure it is always a multiple of 0.25.
    Phil

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1