+ Reply to Thread
Results 1 to 18 of 18

Automatic association with value

  1. #1
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Automatic association with value

    Hello, i'm trying to have values written in a column appear in a second sheet next to pre-defined criteria.

    Like on my sheet, i'm trying to get 'Name' in 'Names' to appear in 'Association' next to each criteria. (see manual example in sheet 'Association').

    How could i do this ? And would it be possible to have it appear automatically without clicking on any button or launching macro (Adding a name in 'Names' and then the rest appears automatically in 'Assocation') ??

    thank you for your help and time !

    here is the file : error.xlsm
    Last edited by clemlcfc; 10-10-2022 at 10:25 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,836

    Re: Automatic association with value

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your Names sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Add a name in column A of the Names sheet and press the ENTER key.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Automatic association with value

    Quote Originally Posted by clemlcfc View Post
    ... And would it be possible to have it appear automatically without clicking on any button or launching macro (Adding a name in 'Names' and then the rest appears automatically in 'Assocation') ??
    Hello.
    Of course it can be done automatically.

    But what if you make a mistake typing a name and retype it "correctly", then you will have created data for the wrong name and data for the correct name?

    That's why I think that -if you want it to be automatic- every time you enter (or delete) a name or a criterion I think it would be best to rewrite the entire resulting table.

    Do you agree?...

  4. #4
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    thank you for your answer. Maybe i did something wrong but it does not seem to work for me !

  5. #5
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    Yes i understand your point. But in that case, would it not be possible that if i delete a value it would delete automatically. I agree it would be easier that everytime i enter (or delete) a name or a criterion it would be best to rewrite the entire resulting table

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,287

    Re: Automatic association with value

    Please Login or Register  to view this content.
    Note: No Error Trapping As Yet
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  7. #7
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    Thank you so much Sintek !

  8. #8
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    @sintek if i had a column in the second table it does not work anymore. Where do i change in the code to select the column manually ?

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,287

    Re: Automatic association with value

    if i had a column in the second table it does not work anymore.
    What does this mean..."had"

    Do you mean ADD

  10. #10
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    yes "add" my bad. my english isn't that good

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,287

    Re: Automatic association with value

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    Thank you for your answer ! 2 questions on that : if i modify the first table and add a column, it will modify the second table for each value that i enter. So how do i modify it to make it only do the program for the first column of the first page ?

    Secondly, how can i also the second table and insert the value in specific columns (let's say 1 and 3 for example) and not the first two like in your example ? And also if a row has value elsewhere than column 1 and 3 (if we keep the logic), to tell the programm the stay in that row and not skip onto the next one directly ?

    thank you for your time and help as always !

  13. #13
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,287

    Re: Automatic association with value

    sample files explaining requirement and expected outcome please

  14. #14
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    here is updated file : error-1.xlsm

    my first problem is column B on first sheet, if i write it will do the programm when i want it to work only for first column.
    second thing is on the second sheet, to modify to put value ok name and criteria in A and C, in the programm it works for first 2 columns.
    And finally if there is value already in other column than 'name' and 'criteria' don't skip the line.

    thank you so much

  15. #15
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,287

    Re: Automatic association with value

    Im sorry, I do not understand what you want...please explain step by step


    Edit...Do you mean...first blank row if available in Col A?
    Untitled.png
    Last edited by sintek; 10-10-2022 at 11:54 AM.

  16. #16
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    Sorry if i was not clear ! yes this is what i mean !

  17. #17
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,287

    Re: Automatic association with value

    and if no empty space in Col A then only insert a new row?
    You are opening a whole can of worms...There are so many variables to take into account...If there is only 1 open cell in Col A then use that cell and add two new rows for other data OR if 2 open then fill 2 and only add 1 new row for last data...etc etc etc ...WHY?
    Last edited by sintek; 10-11-2022 at 03:43 AM.

  18. #18
    Registered User
    Join Date
    09-05-2022
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    85

    Re: Automatic association with value

    You are right it is not optimal. I will think about something else ! thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel question for data association from a table for new data association?
    By meameame12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2017, 08:54 PM
  2. Row Association
    By dataman22 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2014, 10:04 AM
  3. association cells
    By gigi1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 09:46 PM
  4. File Association for xls
    By mannym100 in forum Excel General
    Replies: 6
    Last Post: 01-16-2010, 11:16 AM
  5. List association
    By albyrd33 in forum Excel General
    Replies: 1
    Last Post: 12-24-2009, 04:50 AM
  6. File association
    By spartacusjones in forum Excel General
    Replies: 0
    Last Post: 02-18-2008, 11:55 AM
  7. Data association
    By Jeffrey in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-24-2005, 04:06 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1