My code below creates a new workbook for every cell in Column A starting with A3 and stops when their is no more data. It then copies the data in each cell in column A to cell A4 on the "Input" sheet. So for example, if I had data in A3 and A4 only then I would have 2 workbooks saved each being named after the data that is in cells A3 and A4.
So that code is working right, but what I am trying to do is to add another layer to my workbook file naming convention. Now in addition to naming the file after the data found in each cell Column in A I want it to name the file after the data in column B too. So for example if A3= John and B3=Smith and A4=Peter and B4=Parker then I would end up with two workbooks which are named "JohnSmith.xlsm" and "PeterParker.xlsm"
Does any one know how to do this?
Thanks
Sub WorksheetCopyPaste()
Dim c As Range
With Worksheets("Sheet1")
For Each c In .Range("A3", .Range("A" & Rows.Count).End(xlUp)) 'Loop from A3 to last used cell in column A
Worksheets("Input").Range("A4").Value = c.Value 'Column A
ThisWorkbook.SaveAs "U:\WorkupMailMerge\" & c.Value & ".xlsm"
Next c
End With
End Sub
Bookmarks