I have an excel file containing info about 10-11 sessions. I want to create separate excel files for different sessions with format "ProgramNo. ProgramName - Date". Now, I have got the names from the sheet, but am unable to create and save an excel file with that name.
For Each b In list3
Set n = X.Sheets("2023 Feedback Master").Range("A1:A" & CStr(lastRow)).Find(What:=b, LookAt:=xlWhole)
name = CStr(X.Sheets("2023 Feedback Master").Range("A" & CStr(n.Row)).Value) & ". " & CStr(X.Sheets("2023 Feedback Master").Range("B" & CStr(n.Row)).Value) & " - " & CStr(X.Sheets("2023 Feedback Master").Range("E" & CStr(n.Row)).Value)
MsgBox folderName & name
Workbooks.Add.SaveAs Filename:=folderName & name & ".xlsx"
Next b
In the MsgBox foldername & name, I am getting the proper name format. But when using it in the next line, it gives an error