Age in Userform automatic update

  • Hi, I have a table with different entries, I fill this table using a Userform, so I don't have a fixed number of rows; at the end of the table I put 2 columns:


    the first calculate the age based to the date of birth (FORMULA =DATEDIF(K2;TODAY();"Y") )


    the seconf column say if the guy is adult or not (FORMULA =IF(P2>=16;"adult";"young") )


    I extend the formula to the whole column, but...


    the first of this 2 columns is filled with 115 and the second with adult. Because I need to say how many adult and young there is in my table (and at the moment I have every cell with adult I'm trying to extend this formulas only after I fill a new row.


    I have an idea, if I add to my code to write the formulas in the cell? Or if you have any ideas they are welkome



    Thanks for your help

  • Re: Age in Userform automatic update


    Covert the data to a Table format

    Quote


    To make managing and analyzing a group of related data easier, you can turn a range of cells into a Microsoft Office Excel table (previously known as an Excel list). A table typically contains related data in a series of worksheet rows and columns that have been formatted as a table.


    Overview of Tables


    Change the code in the UserForm to this


  • Re: Age in Userform automatic update


    It works, but not as in your example. When I add something new it creates a new row with all the data, but, it also add another row with just the formulas in the last 2 cells. So it add 2 rows everytime.


  • Re: Age in Userform automatic update


    The example that I posted works so I have no idea what you mean unless you attach the workbook that is not working

Participate now!

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