In this Article
This is the opposite tutorial of the Convert Matrix to Vector tutorial.
The following function takes a single row vector and converts into a matrix:
The function takes 3 arguments:
• The range of the initial vector
• The number of rows required in the matrix
• The number of columns required in the matrix
So if we have:
Then we can call our function:
1. c7:c16 is the matrix range
2. 2 is the number of rows required in the matrix
3. 5 is the number of columns required
And we get:
To download the .XLSM file from this function, click here.
Stop searching for VBA code online. Learn more about AutoMacro – A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!
<<Return to VBA Examples
Did you find this VBA tutorial useful? Then share it with your friends and colleagues: