PhBarreto
New Member
- Joined
- Aug 9, 2016
- Messages
- 25
- Office Version
- 365
- Platform
- Windows
Hello guys!
I have a spreadsheet with 30 sheets and I have the code bellow to.
There is a way to optimize this CODE?
I want a smaller code. What do the same thing for all sheets... and if error, loop or go to next.
Sub CopiarPainelEntregas()
Dim LR As Long
Dim resposta As Integer
Dim YesOrNoAnswerToMessageBox As String
Dim QuestionToMessageBox As String
Application.ScreenUpdating = False
If Sheets("Painel de Entregas").Range("A12").Value <> "" Then
YesOrNoAnswerToMessageBox = MsgBox("Você tem certeza que deseja ATUALIZAR o Painel de Entregas?", vbYesNo, "Atualizar Painel de Entregas")
If YesOrNoAnswerToMessageBox = vbNo Then
Exit Sub
Else
Sheets("Painel de Entregas").Select
Range("A12:I3000").Select
Selection.ClearContents
Range("A11").Select
End If
End If
'ABA 1
On Error GoTo infome
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("c12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("c12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 2
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("d12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("d12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 3
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("e12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("e12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 4
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("f12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("f12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 5
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("g12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("g12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 6
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("h12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("h12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 7
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("i12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("i12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 8
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("j12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("j12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 9
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("k12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("k12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'aba 10
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("L12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("L12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 11
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("M12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("M12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'aba 12
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("N12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("N12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 13
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("O12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("O12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 14
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("P12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("P12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 15
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("Q12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("Q12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 16
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("R12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("R12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 17
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("S12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("S12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 18
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("T12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("T12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 19
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("U12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("U12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 20
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("V12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("V12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 21
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("W12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("W12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 22
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("X12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("X12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 23
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("Y12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("Y12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 24
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("Z12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("Z12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 25
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AA12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AA12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 26
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AB12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AB12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 27
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AC12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AC12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 28
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AD12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AD12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 29
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AE12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AE12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 30
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AF12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AF12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
MsgBox ("Painel de Entregas atualizado com sucesso!")
Sheets("Painel").Select
Exit Sub
infome:
MsgBox ("Erro! Contate o criador da planilha!")
Exit Sub
Application.ScreenUpdating = True
Sheets("Painel").Select
End Sub
I have a spreadsheet with 30 sheets and I have the code bellow to.
There is a way to optimize this CODE?
I want a smaller code. What do the same thing for all sheets... and if error, loop or go to next.
Sub CopiarPainelEntregas()
Dim LR As Long
Dim resposta As Integer
Dim YesOrNoAnswerToMessageBox As String
Dim QuestionToMessageBox As String
Application.ScreenUpdating = False
If Sheets("Painel de Entregas").Range("A12").Value <> "" Then
YesOrNoAnswerToMessageBox = MsgBox("Você tem certeza que deseja ATUALIZAR o Painel de Entregas?", vbYesNo, "Atualizar Painel de Entregas")
If YesOrNoAnswerToMessageBox = vbNo Then
Exit Sub
Else
Sheets("Painel de Entregas").Select
Range("A12:I3000").Select
Selection.ClearContents
Range("A11").Select
End If
End If
'ABA 1
On Error GoTo infome
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("c12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("c12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 2
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("d12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("d12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 3
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("e12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("e12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 4
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("f12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("f12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 5
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("g12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("g12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 6
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("h12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("h12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 7
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("i12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("i12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 8
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("j12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("j12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 9
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("k12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("k12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'aba 10
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("L12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("L12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 11
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("M12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("M12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'aba 12
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("N12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("N12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 13
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("O12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("O12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 14
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("P12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("P12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 15
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("Q12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("Q12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 16
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("R12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("R12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 17
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("S12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("S12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 18
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("T12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("T12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 19
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("U12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("U12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 20
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("V12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("V12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 21
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("W12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("W12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 22
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("X12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("X12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 23
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("Y12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("Y12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 24
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("Z12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("Z12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 25
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AA12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AA12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 26
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AB12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AB12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 27
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AC12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AC12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 28
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AD12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AD12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 29
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AE12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AE12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
'ABA 30
LR = Sheets("Painel de Entregas").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Painel").Select
Sheets(Range("AF12").Value).Select
Range("b08").Select
If Range("b8").Value = "" Then
Else
Range("b08").Select
Range(Selection, Selection.End(xlDown).End(xlDown).End(xlUp)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Painel de Entregas").Range("A" & LR + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Painel de Entregas").Select
Range("a11").Select
Sheets("Painel").Select
Sheets(Range("AF12").Value).Select
Range("b06").Select
Application.CutCopyMode = False
End If
MsgBox ("Painel de Entregas atualizado com sucesso!")
Sheets("Painel").Select
Exit Sub
infome:
MsgBox ("Erro! Contate o criador da planilha!")
Exit Sub
Application.ScreenUpdating = True
Sheets("Painel").Select
End Sub