You are on page 1of 4

'==================================================================================

====
Sub Ajustar_quadro()

If Range("A2").Text Like "LISTAGEM DAS SOLICITA��ES DE MERCADORIAS" Then

' estetica da macro


' Ajustar tamanho das colunas
Columns(1).ColumnWidth = 3
Columns(2).ColumnWidth = 2.4
Columns(3).ColumnWidth = 4.15
Columns(4).ColumnWidth = 40
Columns(5).ColumnWidth = 5.57
Columns(6).ColumnWidth = 5
Columns(7).ColumnWidth = 5
Columns(8).ColumnWidth = 5
Columns(9).ColumnWidth = 5
Columns(10).ColumnWidth = 9

Range("G1:I1").Merge 'mesclar ajustar data

Range("A6").Select
ActiveCell.FormulaR1C1 = "G"

Range("B6").Select
ActiveCell.FormulaR1C1 = "S"

Range("C6").Select
ActiveCell.FormulaR1C1 = "I"

Range("E6").Select
ActiveCell.FormulaR1C1 = "EMB"

Range("H6").Select
ActiveCell.FormulaR1C1 = "SOLIC"

Range("I6").Select
ActiveCell.FormulaR1C1 = "ATN"

Range("J6").Select
ActiveCell.FormulaR1C1 = "GON"

'---------------------
'AJUSTAR GON A ESQUERDA
Columns("J:J").Select
With Selection
.HorizontalAlignment = xlRight
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With

'-------------------------------

' alterar a cor da coluna solicitacao vermelho


Range("H7").Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
'
' tamanho 12 e negrito

Range("I7").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=-183
With Selection.Font
.Name = "Calibri"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Selection.Font.Bold = True
End If

End Sub
'==================================================================================
==============
Sub Filtro()
If Range("A2").Text Like "LISTAGEM DAS SOLICITA��ES DE MERCADORIAS" Then

'----------------------------------------------------------------------------
' adiciona filto
' Range("I6").Select
' Selection.AutoFilter

'-----------------------------------------------------------------------------
'BOBINAS
Set Rng = Range("D7")

valor = "BOBINA PAPEL MIOLO 0,70 110GR P/AVIARIO"

Do While Rng.Value <> ""


Rng.Select

If CStr(Rng.Value) = CStr(valor) Then


Rng.Offset(0, 5).Value = Rng.Offset(0, 4).Value / 2500

End If

Set Rng = Rng.Offset(1, 0)


Loop

'------------------------------------------------------------------------------
End If
End Sub
'==================================================================================
======================
Sub Apagar_Zero()
If Range("A2").Text Like "LISTAGEM DAS SOLICITA��ES DE MERCADORIAS" Then
Dim lLin As Long

Application.ScreenUpdating = False

'Altere o nome da planilha abaixo:


'Change the sheet's name:
With Sheets("Plan1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "C").End(xlUp).Row To 2 Step -1
'If .Cells(lLin, "B").Interior.Color = 65535 Then .Rows(lLin).Delete
'Deletar se tiver fundo amarelo

'==================================================================================
====
' deletar os grupos que nao temos mercadorias
If .Cells(lLin, "A") = "300" Then .Rows(lLin).Delete 'Deletar
If .Cells(lLin, "A") = "301" Then .Rows(lLin).Delete 'Deletar
If .Cells(lLin, "A") = "302" Then .Rows(lLin).Delete 'Deletar
If .Cells(lLin, "A") = "303" Then .Rows(lLin).Delete 'Deletar
If .Cells(lLin, "A") = "304" Then .Rows(lLin).Delete 'Deletar
If .Cells(lLin, "A") = "305" Then .Rows(lLin).Delete 'Deletar
If .Cells(lLin, "A") = "306" Then .Rows(lLin).Delete 'Deletar
If .Cells(lLin, "A") = "501" Then .Rows(lLin).Delete 'Deletar

'==================================================================================
===

If .Cells(lLin, "F") = "0" Then .Rows(lLin).Delete 'Deletar se conter


zero

If .Cells(lLin, "K") <> "" Then .Rows(lLin).Font.Bold = True 'linha que


contem* deixa negrito

'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
Application.ScreenUpdating = True
End If
End Sub
'==================================================================================
================
Sub Imprimir()
If Range("A2").Text Like "LISTAGEM DAS SOLICITA��ES DE MERCADORIAS" Then
' Imprimir Macro
Columns("k:k").Select
Selection.Delete Shift:=xlToLeft

'colocar cogigo de remover zero aqui


Dim lLin As Long

Application.ScreenUpdating = False

'Altere o nome da planilha abaixo:


'Change the sheet's name:
With Sheets("Plan1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "C").End(xlUp).Row To 2 Step -1

If .Cells(lLin, "I") = "0" Then .Rows(lLin).Delete 'Deletar se conter


zero

If lLin Mod 100 = 0 Then DoEvents


Next lLin
End With
Application.ScreenUpdating = True
'=======================================

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


IgnorePrintAreas:=False

End If
End Sub

'==================================================================================
=================================
Sub removZero()
If Range("A2").Text Like "LISTAGEM DAS SOLICITA��ES DE MERCADORIAS" Then
Dim lLin As Long

Application.ScreenUpdating = False

'Altere o nome da planilha abaixo:


'Change the sheet's name:
With Sheets("Plan1") ' nome da panilha
For lLin = .Cells(.Rows.Count, "C").End(xlUp).Row To 2 Step -1

If .Cells(lLin, "I") = "0" Then .Rows(lLin).Delete 'Deletar se conter


zero

If lLin Mod 100 = 0 Then DoEvents


Next lLin
End With
Application.ScreenUpdating = True
End If

End Sub

You might also like