Hello,
I am looking for some help with VBA related questions I have to solve for homework assignment I have.
I am asked to create a VBA subroutine that replaces all 1’s in an array (selection) with a 2 and all 2’s in an array with a 1.
Then I am asked to do the same but using a function instead by doing this previous task and outputting it in a different array in a different selection (Ctrl+Shift+Enter).
What I have so far is the following:
First part)
For this part, I am not sure about the DataRange formula or that my method is correct regarding the For..Loop c's part.Please Login or Register to view this content.
Second Part)
After the ReDim line, I kind of got stuck and didn't know what to do. I had For m and For n from 1 to nRows and nCols consequently; however, I didn't know how to include my conditions of swapping the values of 1 and 2 and outputting that in the array B().Please Login or Register to view this content.
Thank you,
HanadiS
Bookmarks