Hello,
I'm trying to automate a Boolean process on Excel and was hoping to get some help with the loop/vba logic.
Column A contains integers that range between 1-4.
I would like to create 4 columns on the side (since "A" contains 4 possible values) which have the following logic:
If cell A2=2, B2=0, C2=1,D2=0, E2=0.
Similarly if A3=4, B2=0, C2=0, D2=0, E2=1.
So essentially I'd like to create a binary string in columns B, C, D and E based on the value in A.
I would like to do this for the entire column A
I want to be able to do this with a macro as I have many such columns (as "A) that I wish to automate and transform into binary columns (as B, C, D and E)
Please note that of all the columns I have, the value ranges are different, i.e. not all columns range from 1-4.. some of them are 1-2 and some are 1-10 but they are always integers. So the number of columns to create next to each principal column (from this example, principal column = A), will be equal to the max value of the principal column.
Thanks in advance for your help
Ana
I'm trying to automate a Boolean process on Excel and was hoping to get some help with the loop/vba logic.
Column A contains integers that range between 1-4.
I would like to create 4 columns on the side (since "A" contains 4 possible values) which have the following logic:
If cell A2=2, B2=0, C2=1,D2=0, E2=0.
Similarly if A3=4, B2=0, C2=0, D2=0, E2=1.
So essentially I'd like to create a binary string in columns B, C, D and E based on the value in A.
I would like to do this for the entire column A
I want to be able to do this with a macro as I have many such columns (as "A) that I wish to automate and transform into binary columns (as B, C, D and E)
Please note that of all the columns I have, the value ranges are different, i.e. not all columns range from 1-4.. some of them are 1-2 and some are 1-10 but they are always integers. So the number of columns to create next to each principal column (from this example, principal column = A), will be equal to the max value of the principal column.
Thanks in advance for your help
Ana