Private Sub CommandButton1_Click()
Dim str1, str2 As String
[b2] = ""
For i = 2 To Sheet1.UsedRange.Columns.Count
str1 = Application.WorksheetFunction.Substitute(Range(Cells(1, i), Cells(1, i)).Value, "a", "")
str2 = str1 & "," & str2
Next
[b2] = "'" & Left(str2, Len(str2) - 1)
End Sub