Copiar e colar baseado em 3 condições diferentes
Enviado: 20 Mar 2017 às 16:31
Preciso de alguma formar copiar os itens de uma planilha para a outra levando em consideração 3 condições diferentes.
O que fiz foi:
O que fiz foi:
Código: Selecionar todos
Porém está muito "pesado" o código e acaba travando o excel. Acham que tem algum outro jeito mais fácil de fazer?Do While Not IsEmpty(Sheets("Base").Cells(linha, colunaTime))
If Sheets("Base").Cells(linha, colunaProjeto).Value = ComboBoxProjeto.Value Then
If CDate(Sheets("Base").Cells(linha, colunaAtualização).Value) = CDate(ComboBoxAtualização.Value) Then
If DatePart("h", CDate(Sheets("Base").Cells(linha, colunaTime).Value)) = DatePart("h", CDate(ComboBoxTime.Value)) Then
Sheets("Report").Range("M15").Value = Sheets("Base").Cells(linha, colunaDP).Value
Sheets("Report").Range("M10").Value = Sheets("Base").Cells(linha, colunaDR).Value
Sheets("Report").Range("Q15").Value = Sheets("Base").Cells(linha, colunaMdP).Value
Sheets("Report").Range("Q10").Value = Sheets("Base").Cells(linha, colunaMdR).Value
Sheets("Report").Range("U15").Value = Sheets("Base").Cells(linha, colunaAP).Value
Sheets("Report").Range("U10").Value = Sheets("Base").Cells(linha, colunaAR).Value
Sheets("Report").Range("Y15").Value = Sheets("Base").Cells(linha, colunaMP).Value
Sheets("Report").Range("Y10").Value = Sheets("Base").Cells(linha, colunaMR).Value
Sheets("Report").Range("AC15").Value = Sheets("Base").Cells(linha, colunaCP).Value
Sheets("Report").Range("AC10").Value = Sheets("Base").Cells(linha, colunaCR).Value
Sheets("Report").Range("C18").Value = Sheets("Base").Cells(linha, colunaObjetivo).Value
Sheets("Report").Range("Q18").Value = Sheets("Base").Cells(linha, colunaAtividadesRealizadas).Value
Sheets("Report").Range("C26").Value = Sheets("Base").Cells(linha, colunaProximasAtividades).Value
Sheets("Report").Range("Q26").Value = Sheets("Base").Cells(linha, colunaProblemasRiscosEncontrados).Value
Sheets("Report").Range("D6").Value = TextBoxID.Value
Sheets("Report").Range("F6").Value = ComboBoxProjeto.Value
Sheets("Report").Range("C5").Value = ComboBoxLider.Value
End If
End If
End If
linha = linha + 1
Loop