WhackoJako's Test Forum, page-756

  1. 19,112 Posts.
    lightbulb Created with Sketch. 3682
    @roaminoz

    Hi,
    I have been doing some excel VBA stuff today - building a Point and Figure chart.

    I do not actually write VBA code myself, but if I search for something kinda similar online, I can usually find something already written, that I can adapt to do what I need.
    So I am a VBA beginner and I have no idea how to do the next (probably final) step to complete the project, and can't find something to help me online.

    I was about to go to the 'ozgrid' forum and pay for some help, like I have done before when I get stuck like this.
    But I thought I would ask you first, in case the answer is no too difficult after all, and you know how to do it (and also, it helps that you already understand that what I am doing is stock market related, and producing a chart specifically - even though in this case it is not an actual excel chart).

    So I have code that makes a nice neat Point and Figure chart.
    It works perfectly, and looks great, except for one thing.
    I do not ever want a single 'X' or 'O' in a column (this is an important criteria for the 'Wyckoff' specific type of Point and Figure charts).
    Whenever this happens, the entire next column (and the rest of the chart) should shift across, so that the next column combine's with the single 'X' or 'O' to make a mixed column that has at least two or more X's or O's in it (and the rest of the chart moves across with it, so as not to leave any empty columns).

    So effectively, I want VBA code to look at each column starting with column G, and whenever there is a column with only a single X or O in it, combine that column with the next column, to make a mixed column that has two or more X's and/or O's in it (and not leave any empty of vacant columns).
    And continue that process across the entire worksheet until the code finds a column with no X's or O's in it at all (which is the end of the chart), then stop.

    It doesn't sound too hard, but I cant find any code online that can do it for me....

    any thoughts.....did I explain clearly enough so you can understand ??
    or should I just head off to 'Ozgrid' - it probably won't cost very much.

    See the example below-
    The solid red arrows show a single X or O, and inside the Box shows and example of how it should look after being corrected.
    As you can see, if there is a single 'O' in a column, the next column will always start one row up with an 'X' - those X's need to shift across and combine with the 'O' to make a mixed column that has at least two X's or O's in it.
    Same 'but opposite' with a single 'X' in a column, the next column will always start down one row with an 'O' - and these need to shift across and combine with the 'X'
    Also note that there are no empty of vacant columns after merging columns.
    The first column is the stock price, the next column is column F and will always be empty, the the X's and O's start printing on column G to form the PnF chart
    excel 120420.png

    cheers

    .
 
arrow-down-2 Created with Sketch. arrow-down-2 Created with Sketch.