Hello!
I am new here and apologize in advance for any silly question I might ask. I've not had any experience with vba until now.
I am trying to create an easy to use interface for R&D project selection with a pairwise comparison of criteria (see AHP). So far I was able to generate a userform that lets the user select and deselect existing criteria and add new ones. these n criteria are then inserted in the appropriate cells in the worksheet and the n x n weighting matrix is created. Then I created a userform with a slidebar that lets the user compare each criterion with all others and inserts the values in the lower triangular matrix. the values of the upper triangular matrix are generated using =MTRANS. So far this works, sort of.

My problem now is that since the n criteria can be selected the matrix size can change (n x n).

To check for consistency of the weighting input I used a 5 x 5 matrix and manually determined the eigenvalue by squaring and normalizing the matrix etc. and hence getting the priority vector.

So my questions are:

1. How do I compute the eigenvector of a matrix with VBA (or simpler: how do I square matrices, sum rows or colums, normalize and determine row averages)?
2. How do I do this with a variable n x n matrix?

Thank you in advance!