Question: I'm trying to write a macro that matches a cell in the with the sheet name and then pulls data from that sheet and then copies it in the next column with the initial sheet. Here's what I have so far:

```
Sub example() 

 Dim wkSht As Worksheet

  For Each wkSht In Sheets

    For Each Cell In Sheets("Reporting").Range("B2:B200")

        If Cell.Value = wkSht.Name Then

            On Error Resume Next

            wkSht.Range("D15").Copy Destination:=Sheets("Reporting").Range("c2:c36")

        End If

    Next Cell

 Next wkSht

End Sub

```

I want to do that for the whole column but I don't know the code for copying it in the next column over. Basically, it would match the `Cell (B2)` with the sheet tab name and then pull from the same cell in that respective tab and then copy to the next `column (C2)`. And I would do that for `b3`, `b4`, `b5`, till `b200`. Thanks!

Answer: 
This code seems to work fine with me:

```
function validName(array){
  var result=[],lower=[],count=0,len=0;
  for(i in array){
    lower.push(array[i].toLowerCase());
  }
  for(j in lower){
    i=j;i++;if(j==lower.length-1){break;}
    len=lower[j].length-1;
    var u=lower[j].charAt(len);
    var l=lower[i].charAt(0);
    if(u==l){
       result.push(lower[j]);
       count++;
    }
  }
  return result;
}
alert(validName(["Buddy Bear","Romeo", "Olive"]));

```
First, add ";" at the end of command

```
var lower = []

```

↓↓↓

```
var lower = [];

```

Second, assign result into array, then return.

```
for(var i = 0; i < lower.length; i++) {
  ...
  arr_result.push(count);
}
return arr_result;

```

Hope it helps.