You are on page 1of 12

Sub AJUSTAR_QUADRO()

If Range("A1").Text Like "RELATORIO DE ENTRADA/SAIDAS NO ESTOQUE DO DIA" Then


' estetica da macro
' Ajustar tamanho das colunas
Columns(1).ColumnWidth = 2
Columns(2).ColumnWidth = 3
Columns(3).ColumnWidth = 2
Columns(4).ColumnWidth = 3
Columns(5).ColumnWidth = 40
Columns(6).ColumnWidth = 5
Columns(7).ColumnWidth = 6
Columns(8).ColumnWidth = 23
'===============================
Range("A2").Select
ActiveCell.FormulaR1C1 = "F"
Range("b2").Select
ActiveCell.FormulaR1C1 = "G"
Range("c2").Select
ActiveCell.FormulaR1C1 = "S"
Range("d2").Select
ActiveCell.FormulaR1C1 = "I"
Range("E2").Select
ActiveCell.FormulaR1C1 = "NOME"
Range("F2").Select
ActiveCell.FormulaR1C1 = "EMB"
Range("G2").Select
ActiveCell.FormulaR1C1 = "SALDO"
Range("H2").Select
ActiveCell.FormulaR1C1 = "GON"
'================================
Range("H1").Select
ActiveCell.FormulaR1C1 = Now()

'===============================
Rows("1:1").RowHeight = 43.5
Range("A1:H1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
End With
'---------------------------
Range("A1:G1").Select
ActiveCell.FormulaR1C1 = "CONTAGEM DE ESTOQUE DIARIA"
Range("A2").Select

End If
End Sub

'------LUIZ E IVAN---------
'------------------------------
Sub IMPRIMIR_LeI_TODOS()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "310" And .Cells(lLin, "b") <> "311"
And .Cells(lLin, "b") <> "314" And .Cells(lLin, "b") <> "320" And .Cells(lLin, "b")
<> "414" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeI_310()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "310" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeI_311()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "311" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeI_314()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "314" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeI_320()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "320" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeI_410()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "414" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub

'==================
'------DANIEL E LEANDRO---------
'------------------------------
Sub IMPRIMIR_DeL_TODOS()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "315" And .Cells(lLin, "b") <> "312"
And .Cells(lLin, "b") <> "316" And .Cells(lLin, "b") <> "321" And .Cells(lLin, "b")
<> "415" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_DeL_315()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "315" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_DeL_312()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "312" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_DeL_316()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1
'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "316" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_DeL_321()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "321" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_DeL_415()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "415" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'==================
'------VINICIOS E CLEL---------
'------------------------------
Sub IMPRIMIR_VeC_TODOS()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "323" And .Cells(lLin, "b") <> "308"
And .Cells(lLin, "b") <> "309" And .Cells(lLin, "b") <> "319" And .Cells(lLin, "b")
<> "404" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_VeC_323()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "323" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_VeC_308()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "308" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_VeC_309()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "309" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_VeC_319()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "319" Then .Rows(lLin).Delete 'Deletar
'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_VeC_404()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "404" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'==================
'------LARIO E LEONARDO---------
'------------------------------
Sub IMPRIMIR_LeL_TODOS()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "313" And .Cells(lLin, "b") <> "317"
And .Cells(lLin, "b") <> "318" And .Cells(lLin, "b") <> "403" And .Cells(lLin, "b")
<> "405" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeL_313()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "313" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeL_317()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "317" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeL_318()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1
'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "318" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeL_403()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "403" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
'------------------------------
Sub IMPRIMIR_LeL_405()
Call AJUSTAR_QUADRO
With Sheets("Planilha1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "c").End(xlUp).Row To 3 Step -1

'==================================================================================
====
'deletar os grupos que nao temos mercadorias
If .Cells(lLin, "b") <> "405" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===
If .Cells(lLin, "g") = "0" Then .Rows(lLin).Delete 'Deletar se
conter zero
'Desafoga os processos pendentes do Windows a cada 100 linhas
iteradas:
'Kill Windows's process each 100 lines erased:
If lLin Mod 100 = 0 Then DoEvents
Next lLin
End With

End Sub
'------------------------------
Sub Z_IMPRIMIR()
If Range("A1").Text Like "CONTAGEM DE ESTOQUE DIARIA" Then

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _


IgnorePrintAreas:=False
End If
MsgBox "LISTAGEM IMPRESSA"
End Sub

You might also like