Denise Silva
15-09-2020 12:42:47
Olá bom dia,
Poderiam me ajudar. Gostaria de um calculo automático, para preenchimento conforme planilha Status.
Ou seja, a equipe comercial diz a quantidade de venda, e automaticamente vai para a o Overview, neste caso não ele preenche da mesma forma que esta na planilha Status, mas olhando se é venda ou Estoque.
Consegui chegar aqui, mas ele sai preenchendo a primeira para todas as linhas.
Sub Resumo_Vendas()
Range("N5") = WorksheetFunction.VLookup(Planilha2.Range("A10"), Planilha2.Range("A:E"), 4, 0)
End Sub
Sub Fato()
Lin = 5
Do While Cells(Lin, 14).Value <> ""
If Cells(Lin + 1, 1).Value <> "" And Cells(Lin, 14).Value <> "" And Cells(Lin + 1, 14).Value = "" Then
Range(Cells(Lin, 14), Cells(Lin, 14)).Select
Selection.Copy
Range(Cells(Lin + 1, 14), Cells(Lin + 1, 14)).Select
ActiveSheet.Paste
Selection.Font.ColorIndex = 3
End If
Lin = Lin + 1
Loop
Range("F1").Select
Application.CutCopyMode = False
End Sub
Poderiam me ajudar. Gostaria de um calculo automático, para preenchimento conforme planilha Status.
Ou seja, a equipe comercial diz a quantidade de venda, e automaticamente vai para a o Overview, neste caso não ele preenche da mesma forma que esta na planilha Status, mas olhando se é venda ou Estoque.
Consegui chegar aqui, mas ele sai preenchendo a primeira para todas as linhas.
Sub Resumo_Vendas()
Range("N5") = WorksheetFunction.VLookup(Planilha2.Range("A10"), Planilha2.Range("A:E"), 4, 0)
End Sub
Sub Fato()
Lin = 5
Do While Cells(Lin, 14).Value <> ""
If Cells(Lin + 1, 1).Value <> "" And Cells(Lin, 14).Value <> "" And Cells(Lin + 1, 14).Value = "" Then
Range(Cells(Lin, 14), Cells(Lin, 14)).Select
Selection.Copy
Range(Cells(Lin + 1, 14), Cells(Lin + 1, 14)).Select
ActiveSheet.Paste
Selection.Font.ColorIndex = 3
End If
Lin = Lin + 1
Loop
Range("F1").Select
Application.CutCopyMode = False
End Sub