Turning certain elements of a Matrix to zero through multiplication Good evening,
I apologize for the somewhat dumb question, I have to confess, Linear Algebra is not my strong suit. Secondly, the aim of this question is to apply this process to Excel - using VBA.
For a given matrix, e.g.:
$$
A = \begin{pmatrix} 4 & 5 & 6 \\ 7 & 8 & 9 \\ 10 & 11 & 12 \end{pmatrix}
$$
Imagine I want to turn a few of those elements to zero through matrix multiplication, e.g.:
$$
A\times\text{something} = \begin{pmatrix}4 & 0 & 0 \\ 0 & 8 & 9 \\ 0 & 11 & 0 \end{pmatrix}
$$ 
that is, turn specific elements to zero. How can that be achieved?
Thanks ni advance
 A: Let's look at this specific case so that you can be sure that the above will happen.
We have that $AX=B$, where $B$ is the matrix $A$ with suitable entries replaced by zeros.
Note that if we take $A=\begin{pmatrix} 4 &  5&  6 \\  7 & 8 & 9\\ 10 & 11& 12 \end{pmatrix}$, and $B=\begin{pmatrix} 4 &  0&  0 \\  0 & 8 & 9\\ 0 & 11& 0 \end{pmatrix}$,then solving $AX=B$ will be done when $X=A^{-1}B$. $A^{-1}$ will exist when the determinant of $A$ is a non-zero quantity, so you can do this only if the above happens, otherwise $X$ can be one of infinite solutions, or need not exist.
In this case, we can't do what you said, because it turns out that the determinant of the matrix A is zero, and the determinant of the matrix $B$ is $-396$, which is non-zero.
If you add another zero, say $B=\begin{pmatrix} 4 &  0&  0 \\  0 & 8 & 0\\ 0 & 11& 0 \end{pmatrix}$, then $B$ has determinant zero, and suppose $AX=B$, then if we call the columns of any three dimensional square matrix $M$ as $M_1,M_2,M_3$, it says that:
$AX_1=B_1$,$AX_2=B_2$,$AX_3=B_3$ have to be satisfied together. This can be verified using Cramer's rule, to happen infinitely often if the determinant of the three matrices $[B_1\ A_2\ A_3]$, $[A_1\ B_2\ A_3]$, and $[A_1\ A_2\ B_3]$ are all zero.
This doesn't happen because :
$[B_1\ A_2\ A_3]=\begin{pmatrix} 4 &  0&  0 \\  7 & 8 & 9\\ 10 & 11& 12 \end{pmatrix} \implies \det [B_1\ A_2\ A_3] = -12 \neq 0$.
Hence, there is no solution to $X$ here as well.
So you have to choose your zeros wisely if you want a solution, and in particular if $A$ is invertible it makes life much easier.
If the matrices $A$ and $B$ are not square, it makes life much worse, with the introduction of pseudoinverses and concepts like that, but it's much better to stay square.  
A: So the mathematical problem you are trying to solve. You have a square target matrix $T$, and same-dimensional square start matrix $S$, you want to compute a square matrix $U$ such that 
$$ SU = T$$
In the case that $S$ is invertible this is easily done by just computing 
$$ U = S^{-1} T$$ 
with any matrix inverting algorithm of your choice. But there's a chance that $S$ isn't invertible, in that case one needs to be ready to used a generalized inverse. 
Some classical ones are the "left and right" inverses:
$$ (S^T S )^{-1} S^T$$
$$ S^T(S S^T)^{-1}$$
But it may not always be the case that even $S S^T$ are invertible... in that case you need to resort to more powerful tools such as the Moore Penrose Pseudo Inverse.
As far as a numerical efficiency goes these matrix multiplications are pretty fast, but if you know the structure of your data ahead of time there might be customizations you can make. 
