Ir para conteúdo
Fórum Script Brasil

benzadeus

Membros
  • Total de itens

    84
  • Registro em

  • Última visita

Tudo que benzadeus postou

  1. Vá na janela de Configurar Página (normalmente presente nos menus de impressão) e vá na aba Planilha. No campo "Linhas a repetir na parte superior" apague tudo e clique em OK.
  2. http://social.msdn.microsoft.com/Forums/pt...a7-602bf3a0f4c6
  3. Sim, é normal. No entanto, tente usar: Sub Fazer() Application.ScreenUpdating = False With ThisWorkbook.Sheets("Plan1") '<- mude o nome para a Planilha desejada .Rows(2).Insert Shift:=xlDown .Rows(1).Copy .Rows(2).PasteSpecial xlPasteValues .Rows("31:31").Delete End With Application.ScreenUpdating = True End Sub O efeito de piscar será mais suave.
  4. benzadeus

    Macro congela

    A macro fica mais rápida se você armazenar todos os valores de linha numa variável e depois ocultá-las todas de uma vez: Sub OcultarRow_Col() Dim SomaColuna, ultimalinha, ultimacoluna, r, y As Integer Dim rng As Range Dim lng As Long Sheets("Diversos").Select ultimalinha = ActiveSheet.Range("V3") r = 0 y = 0 SomaColuna = 0 ultimacoluna = 0 Application.ScreenUpdating = False Application.Calculation = xlCalculationManual ' Oculta Linha Set rng = Rows(1) 'rng não pode ser Nothing inicalmente senão um erro é retornado For r = ultimalinha To 4 Step -1 If Cells(r, 17) = 0 Then Set rng = Union(rng, Rows(r)) End If Next r rng.Hidden = True Set rng = Rows(1) 'rng não pode ser Nothing inicalmente senão um erro é retornado For lng = 101 To 121 If Cells(lng, 5) + Cells(lng, 6) + Cells(lng, 7) + Cells(lng, 8) = 0 Then Set rng = Union(rng, Rows(lng)) End If Next lng rng.Hidden = True r = 0 y = 0 SomaColuna = 0 ultimalinha = 0 ultimacoluna = 16 ' Oculta coluna For r = ultimacoluna To 1 Step -1 'soma Positivos If Cells(98, r) = 0 And r <> 12 Then Columns(r).Hidden = True Else If r = 12 Then SomaColuna = 0 For y = 4 To 95 Step 1 SomaColuna = SomaColuna + Abs(Cells(y, 12)) Next y If SomaColuna = 0 Then Columns(12).Hidden = True End If End If End If Next r Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub
  5. benzadeus

    PowerPoint

    Não entendi exatamente o que deseja, mas veja um exemplo de como se acessar o modelo de objeto do PowerPoint neste link: http://www.ambienteoffice.com.br/powerpoin..._numa_planilha/
  6. Sub Fazer() With ThisWorkbook.Sheets("Plan1") '<- mude o nome para a Planilha desejada .Rows(2).Insert Shift:=xlDown .Rows(1).Copy .Rows(2).PasteSpecial xlPasteValues .Rows("31:31").Delete End With End Sub
  7. Sub Exemplo() Dim dt As Date Dim lDias As Long 'DateSerial(Ano, Mês, Dia) dt = DateSerial(2012, 2, 15) lDias = Day(DateSerial(Year(dt), Month(dt) + 1, 0)) MsgBox "O mês da data " & dt & " tem " & lDias & " dias.", vbInformation End Sub
  8. benzadeus

    Verificar Registro

    Veja http://scriptbrasil.com.br/forum/index.php?showtopic=168892
  9. Sub Exemplo() Dim dNúmeroPeríodos As Double Dim dValorPresente As Double Dim dTaxa As Double Dim dValorParcelas As Double dTaxa = 0.015 dNúmeroPeríodos = 3 dValorPresente = 800 dValorParcelas = VBA.Pmt(dTaxa, dNúmeroPeríodos, -dValorPresente) MsgBox dValorParcelas End Sub
  10. Olá, Não consegui abrir seu exemplo, mas acredito que este link possa te ajudar: http://www.ambienteoffice.com.br/excel/ger...o_e_uma_tabela/
  11. http://www.ambienteoffice.com.br/officevba...e-mail_por_vba/ :)
  12. Sub Exemplo() Dim rng As Range Dim sPrimeiro As String Dim sBusca As String Dim rBanco As Range sBusca = "Benzadeus" Set rBanco = Cells 'Toda Planilha Set rng = rBanco.Find(What:=sBusca _ , LookIn:=xlValues _ , LookAt:=xlPart _ , MatchCase:=False) If Not rng Is Nothing Then sPrimeiro = rng.Address Do MsgBox "'" & sBusca & "' encontrado na célula " & rng.Address(0, 0) & "'." Set rng = rBanco.FindNext(rng) Loop While Not rng Is Nothing And rng.Address <> sPrimeiro Else MsgBox "Nenhuma ocorrência de '" & sBusca & "' encontrada." End If End Sub
  13. Olá, Tente usar: Sub Teste() Application.EnableEvents = False ActiveCell.Range("A1:AM1").Copy Destination:=Sheets("resolvidas").Range("A3").Select Sheets("resolvidas").Unprotect "12312" Sheets("resolvidas").End(xlDown).Offset(1, 0).Paste ActiveCell.Range("S1:AM1").ClearContents Sheets("resolvidas").Protect "12312" Application.EnableEvents = True End Sub
  14. Sub Fazer() With ThisWorkbook.Sheets("Plan1") '<- mude o nome para a Planilha desejada .Rows(1).Copy .Rows(2).Insert Shift:=xlDown .Rows("31:31").Delete End With End Sub
  15. Na célula H18, escreva a fórmula: =ÍNDICE($A$1:$D$10;CORRESP(H15;$A$1:$A$10;0);CORRESP(G15;$A$1:$D$1;0))
  16. benzadeus

    Macro congela

    Experimente trocar ' Application.ScreenUpdating = False ' Application.Calculation = xlCalculationManual por Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Isto é, remover as aspas.
  17. Não entendi muito bem quando disse "nuvem". Veja um exemplo de monitoramento de Pasta de Trabalho: http://www.ambienteoffice.com.br/excel/mon...ta_de_trabalho/
  18. Você poderia disponibilizar uma Pasta de Trabalho como modelo para análise?
  19. Use a fórmula SOMASE: Considerando que as descrições estão na coluna C e os valores na D: =SOMASE(C6:C1000;"ADIANT SALARIO VIA NET";D6:D1000)
  20. benzadeus

    VBA Excel

    Use =SOMA(B:B)
  21. benzadeus

    Worksheet_Change

    Você pode declarar uma variável como estática, que armazenará o último valor de C17. Dessa forma, pode sempre testar o valor antigo com o novo.
  22. Não há muito o que fazer porque não é possível atribuir a janela que abre à uma variável. Não consegui também usar o método SendKeys. Você não consegue alterar diretamente esse rótulo ao lado do botão 'Procurar' diretamente não? Se sim, problema resolvido. Não tentei fazer isso.
  23. Informações adicionais em http://www.ambienteoffice.com.br/excel/PRO...erios_multiplos
  24. Veja http://www.ambienteoffice.com.br/excel/val...tas_dependentes
  25. Não tenho como testar, mas experimente trocar ActiveChart.SetSourceData Source:=Sheets("Plan2").Range(Cells(X, 58), Cells(y, 54)).Select, _ PlotBy:=xlColumnsActiveChart.Location Where:=xlLocationAsObject, Name:="Plan1" por ActiveChart.SetSourceData Source:=Sheets("Plan2").Range(Cells(X, 58), Cells(y, 54)), _ PlotBy:=xlColumnsActiveChart.Location Where:=xlLocationAsObject, Name:="Plan1"
×
×
  • Criar Novo...