Search cycles by employee Excel 2007

  • Goodnight I come to ask for help with a survey of cycles carried out by an employee.


    In the Cycles Tab, I put the employee number in cell A3, and the VBA code will do a search on the Scale Tab from cell AI7 to cell BZ37 and count the number of times the number appears in cell A3 on the Cycles Tab and every 4 times the number found counts 1 cycle, example, 4x33= 1 cycle, 8x33=2 cycles, 12x33= 3 cycles, 16x33=5 cycles, etc.


    In this example, I already put the number in the Cycles Tab in cell A3 and the employee counted 5 cycles as it appears in cell A9 of the Cycles Tab. Now I intend whenever I put a number in A3, the VBA code gives me the cycles made by that employee in A9. If the number placed in A3 of the Cycles tab does not exist, I will receive a MsgBox: "This number does not exist, please enter another number".


    Whenever I put a number in A3 of the Cycles Tab, the existing data in D11 to AU 41 and in cell A9 of the Cycles Tab, must be cleared to show the data of the number that I am putting in A3. I hope I explained myself well so you understand what I mean.


    Thanks Compliments

  • Hi,


    In your cell A9, you can have following formula

    Code
    =IF(COUNTIF(Escala!$AI$7:$BZ$37,A3)=0,"Outro Número ",COUNTIF(Escala!$AI$7:$BZ$37,A3)/4)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

    Edited once, last by Carim ().

  • Good afternoon


    Thanks in advance for your help.


    But I would like that, whenever I put a number in A3, the existing data in D11 to AU41 would be cleaned and it would show me the number that I am putting in A3 in D11 to AU41 as it is in the excel that I attached in the forum.

    It will be possible?? I apologize for the work I'm giving you, but I would like the final result like this.


    Thanks Compliments

    Edited once, last by Carim: Removed Code Tags ().

  • Você é bem vindo ;)


    Thanks a lot for your Thanks AND for the Like 8)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!