title: Split data into multiple Workbooks based on column
body: <p>I am trying to split my data into multiple excel files that will carry the name of my "unique value". I usually perform this task every day.</p>
  
  <p>I have about 50 columns, column A contains the unique value, which can be repeated several times. The other columns carry information regarding the unique value. I would also prefer if the original formatting of the file remains.</p>
  
  <p>I have the macro which is splitting the data within workbook (multiple worksheets). But I want to split the data into different workbooks. If possible, save the different workbooks with unique value name.</p>
  
  <p>Code: `</p>
  
  <pre><code>Sub parse_data()
  Dim lr As Long
  Dim ws As Worksheet
  Dim vcol, i As Integer
  Dim icol As Long
  Dim myarr As Variant
  Dim title As String
  Dim titlerow As Integer
  vcol = 1        
  Set ws = Sheets("Sheet1")        
  lr = ws.Cells(ws.Rows.Count, vcol).End(xlUp).Row
  title = "A1:C1"            
  titlerow = ws.Range(title).Cells(1).Row
  icol = ws.Columns.Count
  ws.Cells(1, icol) = "Unique"
  For i = 2 To lr
  On Error Resume Next
  If ws.Cells(i, vcol) &lt;&gt; "" And Application.WorksheetFunction.Match(ws.Cells(i, vcol), ws.Columns(icol), 0) = 0 Then
  ws.Cells(ws.Rows.Count, icol).End(xlUp).Offset(1) = ws.Cells(i, vcol)
  End If
  Next
  myarr = Application.WorksheetFunction.Transpose(ws.Columns(icol).SpecialCells(xlCellTypeConstants))
  ws.Columns(icol).Clear
  For i = 2 To UBound(myarr)
  ws.Range(title).AutoFilter field:=vcol, Criteria1:=myarr(i) &amp; ""
  If Not Evaluate("=ISREF('" &amp; myarr(i) &amp; "'!A1)") Then
  Sheets.Add(after:=Worksheets(Worksheets.Count)).Name = myarr(i) &amp; ""
  Else
  Sheets(myarr(i) &amp; "").Move after:=Worksheets(Worksheets.Count)
  End If
  ws.Range("A" &amp; titlerow &amp; ":A" &amp; lr).EntireRow.Copy Sheets(myarr(i) &amp; "").Range("A1")
  Sheets(myarr(i) &amp; "").Columns.AutoFit
  Next
  ws.AutoFilterMode = False
  ws.Activate
  End Sub`
  </code></pre>