Consulting

Results 1 to 20 of 41

Thread: How do i automatically get a column of a table filled up after having other values

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,433
    Location
    Quote Originally Posted by Zaxest View Post
    Such as if the matrix changed like if a likelihood and impact was changed to result in a different risk rating.


    For example if "Rare" likelihood and "Insignificant" impact will now return the risk rating of "Low" but if suddenly I need to have it return a risk rating of "Medium".
    No changes to the code would be required for that or for colour changes.
    Quote Originally Posted by Zaxest View Post
    Also is the formula "Vlookup" possible to be implemented in word for a risk assessment document like this or is macro the best way to go?
    Word has no lookup functions of any kind.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  2. #2
    VBAX Regular
    Joined
    Mar 2020
    Posts
    25
    Location


    No changes to the code would be required for that or for colour changes.


    Word has no lookup functions of any kind.[/QUOTE]

    Oh why would no changes to the code be required for any changes to the table?
    Is it already built into the code to adapt should the referenced matrix table to changed?

  3. #3
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,433
    Location
    Quote Originally Posted by Zaxest View Post
    Oh why would no changes to the code be required for any changes to the table?
    Because the code reads the matrix directly. If you look at the code, you'll see there's no mention of the risk ratings or the colours associated with them.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    VBAX Regular
    Joined
    Mar 2020
    Posts
    25
    Location
    Quote Originally Posted by macropod View Post
    Because the code reads the matrix directly. If you look at the code, you'll see there's no mention of the risk ratings or the colours associated with them.
    Ahh may i know which part of the code links the table below to read from the matrix directly?
    Oh and what if in the future i may want to add yet another table to read from the matrix above directly(which have the same titles of Likelihood and Impact) , is there a fast way of coding it?
    Would it be fine if I could skype you and share my screen if thats okay with you
    I cannot thank you enough for all the assistance that you have provided me, thank you so much Paul.

  5. #5
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,433
    Location
    Quote Originally Posted by Zaxest View Post
    Ahh may i know which part of the code links the table below to read from the matrix directly?
    The code between 'Select Case .Title' and 'End Select' retrieves the dropdown indices for the user's choices, as values i and j. The next With … End With turns those into matrix positions via the 'Tbl.Cell(j + 2, 9 - i)' code.
    Quote Originally Posted by Zaxest View Post
    Oh and what if in the future i may want to add yet another table to read from the matrix above directly(which have the same titles of Likelihood and Impact) , is there a fast way of coding it?
    As written, your new table would need its own matrix - with the same layout for the first 8 rows, though (even with the existing matrix) you could use more or fewer impact & likelihood rows & columns - and even change what's in each cell (the '9 - i' would need adjustment to suit any change in the rows).
    Quote Originally Posted by Zaxest View Post
    Would it be fine if I could skype you and share my screen if thats okay with you
    That would be contrary to the intent of the rules here: http://www.vbaexpress.com/forum/faq....aq_req_help_pm
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  6. #6
    VBAX Regular
    Joined
    Mar 2020
    Posts
    25
    Location
    Quote Originally Posted by macropod View Post
    The code between 'Select Case .Title' and 'End Select' retrieves the dropdown indices for the user's choices, as values i and j. The next With … End With turns those into matrix positions via the 'Tbl.Cell(j + 2, 9 - i)' code.

    As written, your new table would need its own matrix - with the same layout for the first 8 rows, though (even with the existing matrix) you could use more or fewer impact & likelihood rows & columns - and even change what's in each cell (the '9 - i' would need adjustment to suit any change in the rows).

    That would be contrary to the intent of the rules here: http://www.vbaexpress.com/forum/faq....aq_req_help_pm
    So if the tables are in different sections as shown in the attached document we will have to re-code the code for that section after i add in another matrix in that new table itself?
    SECTIONCandG.docm

Tags for this Thread

Posting Permissions

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