Yes. Put this function in at the end of your code:
Sub WriteCSVFile(logSTR As String)
Dim My_filenumber As Integer
My_filenumber = FreeFile
Open "C:\MyFolder\Sample.csv" For Append As #My_filenumber
Print #My_filenumber, logSTR
and this inside your main sub:
Dim MyString as String
MyString = "value11,value12,value13"
MyString = "value21,value22,value23"
it will create the Excel file in C:\MyFolder
Yes! This worked for me. Thank you!