Hello,
VBA novice here. Found this code and adjusted it to fit my needs but it's not quite hitting the mark. Needs a slight tweak.
Macro is supposed to split master file in to separate ones at every change in Supervisor name. Header row is being copied to new file, but no other data. Can't figure out why.
Sample workbook attached. Thank you in advance for any and all help.
I altered the save line to the code below and it saved four individual workbooks to my desktop suitable named.
is it the fact you call '\Desktop\Desktop' a double call.
According to the attachment an Excel basics VBA demonstration as a beginner starter :
PHP Code:
Sub Demo1()
With Application
.DisplayAlerts = False
.ScreenUpdating = False
With [A1].CurrentRegion.Columns
.Item(1).AdvancedFilter 2, , .Cells(1, .Count + 3), True
Workbooks.Add xlWBATWorksheet
For Each V In Range(.Cells(2, .Count + 3), .Cells(1, .Count + 3).End(xlDown)).Value
.Cells(2, .Count + 3) = V
.AdvancedFilter 2, .Cells(1, .Count + 3).Resize(2), [A1].CurrentRegion.Rows(1)
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & V, 51
Next
.Cells(1, .Count + 3).CurrentRegion.Clear
End With
ActiveWorkbook.Close
.DisplayAlerts = True
.ScreenUpdating = True
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon ? ★ Add Reputation ? ! ◄ ◄
Bookmarks