Consulting

Results 1 to 7 of 7

Thread: Macro recording gives different result in graph

  1. #1
    VBAX Regular
    Joined
    Aug 2014
    Posts
    6
    Location

    Macro recording gives different result in graph

    HI,

    Simple problem... :-)
    I have a file that contains two collums.
    I need to graph the first A collum "mm" to the second B collum "Force" from cell 13 downwards.

    I import the file and recorded a macro for creating the graph.

    I adapted the macro to run it all automaticly.

    But the recorded part of the graph does not what I want it makes an other graph. wrong.jpg


    if I manualy create from the same data a graph it works fine. correct.jpg

    What do I do wrong?

    As the file size is dynamic I also need to make variable to it accepts not fixed number of cells but looks if cell is filled and create the graph according to the filled cell when the data is imported.

    Any help in the right direction would be appriciated.
    Attached Images Attached Images

  2. #2
    VBAX Regular
    Joined
    Aug 2014
    Posts
    6
    Location
    I try to post the code but I get this

    Post denied. New posts are limited by number of URLs it may contain and checked if it doesn't contain forbidden words.

    Paco
    Last edited by paco; 08-14-2014 at 01:38 PM.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    Try attaching a workbook with the code, by clicking on the Go Advanced button, then scroll down to manage attachments and follow the prompts from there. I'm very confident we can arrive at a solution for you
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  4. #4
    VBAX Regular
    Joined
    Aug 2014
    Posts
    6
    Location
    Thanks for the advice.

    I attached it as macro xlsm
    Attached Files Attached Files

  5. #5
    VBAX Regular
    Joined
    Aug 2014
    Posts
    6
    Location
    One of the files to import. Sorry had to zip it as txt is not accepted........

  6. #6
    VBAX Regular
    Joined
    Aug 2014
    Posts
    6
    Location
    OK, I am one step further.
    Can import the file and select the dynamic entries in collum A and B using Lastrow.
    I know this is not 100% dynamic but it is a start :-)

    However I keep getting the same two series graph when I automaticly let the macro run.
    Regardless if I use xlXYScatterSmoothNoMarkers or xlLine I still get the same graph (see previous wrong.jpg)
    Again by manual selecting the graph I get the correct one.
    New workbook is attached and will run by importing the .txt file.

    Any help would be appriciated.

    Paco
    Attached Files Attached Files

  7. #7
    VBAX Regular
    Joined
    Aug 2014
    Posts
    6
    Location
    Solved.

    Switching two lines did the trick.

    Ammended file attached.
    Attached Files Attached Files

Posting Permissions

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