In my file I have a list of sheet names that correspond with values in column A in a summary page. I want to pull, from each sheet, the value in cell B6 and paste it in the corresponding row of that client in the summary sheet. I've been trying to look up which to copy and paste from based on the value in column A by copying from the sheet that is named with the value of the text of column A, but I'm getting a "Subscript out of range" error at the Worksheets(a).Range("B6").Copy issue. Code below:
Sub columnfiller()
Dim i As Integer
Dim a As String
a = Worksheets(2).Cells(7 + i, "A").Text
For i = 3 To Worksheets.Count
Worksheets(a).Range("B6").Copy
ActiveSheet.Paste Destination:=Worksheets(2).Cells(7 + i)
Next i
End Sub
7+i is the reference to the first cell in the table.