Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
Por DennerSantos
Posts
#64107
Ola galera tudo bem? precisava de mais uma ajuda nesse código ele estava funcionando tudo bem ate eu inserir a linha de vencimento agora quando ele busca na planilha e a celula esta em branco ela retorna com erro e precisava fazer ele ignorar somente essa parte quando tiver em branco mais continuar buscando o resto da linha
Código: Selecionar todos
Sub relatorio()
    Plan7.Range("A15:h50").ClearContents
    ultimalinha = Planilha1.Cells(Rows.Count, "a").End(xlUp).Row
    lin = 15
    For i = 2 To ultimalinha
        If Planilha1.Cells(i, 7) = Range("E6") Then
            Plan7.Cells(lin, 1) = Planilha1.Cells(i, 1) 'Movimento
            Plan7.Cells(lin, 2) = Planilha1.Cells(i, 2) 'Tipo
            Plan7.Cells(lin, 3) = Planilha1.Cells(i, 3) 'Status
            Plan7.Cells(lin, 4) = DateValue(Format(Planilha1.Cells(i, 4), "mm/dd/yyyy")) 'Data
            Plan7.Cells(lin, 5) = DateValue(Format(Planilha1.Cells(i, 5), "mm/dd/yyyy")) 'Vencimento
            Plan7.Cells(lin, 6) = Planilha1.Cells(i, 9) 'Valor
            Plan7.Cells(lin, 7) = Planilha1.Cells(i, 8) 'Descrição
            Plan7.Cells(lin, 8) = Planilha1.Cells(i, 14) 'Resolvido
            lin = lin + 1
        End If
        
    Next
End Sub
Att, Obrigado desde ja
#64111
#
Experimente:
Código: Selecionar todos
  If Planilha1.Cells(i, 5) <> "" Then Plan7.Cells(lin, 5) = DateValue(Format(Planilha1.Cells(i, 5), "mm/dd/yyyy")) 'Vencimento
Bikke, DennerSantos agradeceu por isso
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord