+ Reply to Thread
Results 1 to 5 of 5

Can’t get chosen range on x axis.

  1. #1
    Registered User
    Join Date
    04-03-2014
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Can’t get chosen range on x axis.

    Hi there, I’m really new to this whole vba thing so please be kind .

    I’m trying to write a macro that selects a specific sheet, and then selects ranges on that sheet based on column title. With this selection I want it to draw a scatter graph. However, the problem I’m having is that once the graph is drawn the values on the x axis are only integers, not "time" which is the range of my choosing. Time is plotted as another series on the Y axis? How do I solve this? It’s also worth mentioning that this macro works on some files but not others, even though the files are identical in every way (e.g number of columns, column titles etc) except for the values within the cells and the number of cells with data.

    here is the code:

    Please Login or Register  to view this content.
    Last edited by theherbalist; 04-03-2014 at 03:37 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Can’t get chosen range on x axis.

    How does the chart turn out if you manually draw it up in a file where the macro is not running correctly?
    Does it also turn out incorrectly with the time on the Y-Axis?
    Regards,
    Rudi

  3. #3
    Registered User
    Join Date
    04-03-2014
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Can’t get chosen range on x axis.

    Hmm good point, unfortunately I don’t have access to that file right now, but i just tried it in a fake spreadsheet that I just mocked up and both using the macro and manually drawing the graph works. It makes no sense (to me) whit it would work on some files but no others.
    Thanks for your reply.

  4. #4
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Can’t get chosen range on x axis.

    If it makes no sense on your side, it is even foggier on my side.
    It could help to post a desensitized copy of your file so we can assist further.
    Without knowing your file structure and the formats of your data, we can only guess.

  5. #5
    Registered User
    Join Date
    04-03-2014
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Can’t get chosen range on x axis.

    Yeah I thought that would be the case. I’ll try and post a desensitized version tomorrow or at the weekend. As I said I don’t have access to those files right now. however if anyone can spot anything blatantly wrong with my cod ethen feel free to let me know.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. UDF concatenate randomly chosen cells from range
    By DannyNYC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2014, 02:45 AM
  2. Replies: 22
    Last Post: 06-02-2012, 11:45 AM
  3. Replies: 0
    Last Post: 07-08-2011, 02:25 PM
  4. Replies: 4
    Last Post: 07-17-2009, 09:46 PM
  5. [SOLVED] How to insert X axis scale values next to axis and X axis grid lin
    By vp23larry in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-23-2005, 11:05 AM

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