O que preciso é que quando clicar em produtividade ,rode este código:
Option Private Module
Sub Elimina_Dup()
Desprot2
Dim Linha, Coluna As Variant
Linha = 15
Coluna = 1
Coluna2 = 12
Application.ScreenUpdating = False
Plan1.Visible = xlSheetVisible
Sheets("RESUMO").Select
Do While Worksheets("RESUMO").Cells(Linha, 1) <> ""
Linha = Linha + 1
Loop
Do While Worksheets("RESUMO").Cells(Coluna, 1) <> ""
Coluna = Coluna + 1
Loop
ActiveSheet.Range(Worksheets("RESUMO").Cells(15, 4), Worksheets("RESUMO").Cells(Linha - 1, Coluna)).Select
Selection.Copy
Range("B14").Select
Sheets("Produtividade").Select
Desprot
Range("M1").Select
ActiveSheet.Paste
Sheets("Produtividade").Range("P1:P100").Select
Selection.Copy
Range("L2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Range(Worksheets("Produtividade").Cells(1, 12), Worksheets("Produtividade").Cells(Linha, Coluna2)).RemoveDuplicates Columns:=1, Header:=xlYes
Columns("M:q").EntireColumn.AutoFit
Range("M1").Select
ActiveWindow.DisplayGridlines = False
Range("L2").Select
Selection.Copy
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L3").Select
Application.CutCopyMode = False
Selection.Copy
Range("B8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L4").Select
Application.CutCopyMode = False
Selection.Copy
Range("B10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L5").Select
Selection.Copy
Range("B12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L6").Select
Application.CutCopyMode = False
Selection.Copy
Range("B14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L7").Select
Application.CutCopyMode = False
Selection.Copy
Range("B16").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L8").Select
Selection.Copy
Range("B18").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L9").Select
Application.CutCopyMode = False
Selection.Copy
Range("B20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L10").Select
Application.CutCopyMode = False
Selection.Copy
Range("B22").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("L11").Select
Selection.Copy
Range("B24").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("produtividade").Select
Columns("L:P").Select
Selection.Delete shift:=xlToLeft
Range("B4").Select
Prot
Plan1.Visible = xlSheetVeryHidden
Prot2
Application.ScreenUpdating = True
End Sub
que por sua vez DEVERIA ver em RESUMO apartir de D15 os executores ;
"depositar" em Produtividade apartir de B6 ;
"depositar" o G (m²) em Produtividade apartir de D6 ;
"depositar" o H (valor de US) em Produtividade apartir de G6 ;
caso hajam executores coincidentes em Resumo , somar o m² e o valor de US em produtividade .
exemplo:
Claudinei executa 10m² com valor de US de 7,00 +
Claudinei executa 15m² com valor de US de 9,00,
em produtividade deve aparecer
B (Executor) ------ D(m²)-----------G(us)
Claudinei ----------- 25----------------15
espero ter sido mais claro ; e muito obrigado pela costumeira prestatividade
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 17/10/2012 1:37 pm