Find() in VBA not working as planned

  • Hi all,


    Here is my code:


    The first routines work well. The Formula routine certaily adds a formula, but it adds it to every cell in column G.


    The routine should:

    • Find the first cell in column A which is in the format 15???
    • Go across to column G and input a formula which returns the number in colum F, but the next row

    Instead of this, it is doing the following:

    • Finding the first used cell in column A
    • Input a formula in column G of that same row, but which returns the value of the adjacent cell in column F
    • And adds one to that value


    Is anyone able to help me here?


    Thank you,


    Neil

  • Try:

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Thanks Mumps!


    That worked great!


    I'll study this to find out how everything works.


    BTW, I usually leave putting ScreenUpdating in until I have the macro working - found that out the hard way, LOL!


    There is a follow up request to this same procedure, should I put it here, or begin a new Topic?


    Thanks,


    Neil

  • Hi Mumps,


    Your code worked really well, and I like the use of an Array() to populate the Row.


    There is an extra step required, however, but I really needed to know how to fix my initial Find() problem.


    Here is a cut down version of my sheet:


    [ATTACH]n1218834[/ATTACH]


    As you can see, there are some times when there are multiple rows under the Account heading. While 98% of them will work great with your formula, I need to know how to account for these multiple rows.


    Thank you,


    Neil

  • Try:

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.