Boa tarde!!
Eu não prestei muita atenção, tenho algo próximo em outro fórum, talvez você possa aproveitar.
http://profwillianexcel.forumeiros.com/ ... utra-pasta
Sub Operador()
Dim myOperator As String, _
myFrom As Integer, _
myRow As Integer, _
myCount As Integer, _
myTo As Integer
myRow = 2
myFrom = 2
While Cells(myRow, 1) <> ""
myCount = WorksheetFunction.CountIf(Range(Cells(2, 1), Cells(1000, 1)), Cells(myFrom, 1))
myTo = myFrom + myCount - 1
myOperator = Cells(myFrom, 1)
Range(Cells(1, 1), Cells(myTo, 8)).Copy
Workbooks.Add
ActiveSheet.Paste
Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
If myFrom > 2 Then
Rows("2:" & (myFrom - 1) & "").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End If
ActiveWorkbook.SaveAs Filename:="C:Documents and Settings" & myOperator & ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ActiveWindow.Close
myRow = myFrom + myCount
myFrom = myRow
Wend
ActiveWorkbook.Save
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 17/12/2012 11:56 am