Array concept and looping doubt

Copper Contributor

In attached excel you can find two columns of data where 

 

Column A- Industry

Column B- Engine no

 

In column F you can find the status of engine, here i need to get the status of engine output in Column C using VBA code

 

Let me know how to store column B in array and then looping thru each value to get desired output in Column C 

 

How to make comparison here with looping each value from array with values from column F

 

Is there any way to write this in formula 

 

 

 

 

 

4 Replies

@Nandhu19940you should read Chapter 6,7,8 to complete this job. This will help you to code your work.

 

https://excelsirji.com/vba-for-beginners/

 

Thanks

Kapil

@Nandhu19940  is this a class assignment?  I ask because you say you have to use VBA when this is a simple VLOOKUP function that can be put in col C (e.g.  =VLOOKUP(B2,$E$3:$F$10,2,FALSE) )

var a = []; // Create a new empty array.
a[5] = 5; // Perfectly legal JavaScript that resizes the array.

for (var i = 0; i < a.length; i++) {
// Iterate over numeric indexes from 0 to 5, as everyone expects.
console.log(a[i]);
}

/* Will display:
undefined
undefined
undefined
undefined
undefined
5
*/

@mtarler Thanks lot 

Moreover array also i need to do , not know how to do that.

 

I just succeeded in stored the entire column values in array as variant but further i don't know how to proceed.

 

More doubts in using loop here in my array.