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 JayltonLuiz
Posts
#27086
Boa tarde,Com a ajuda do pessoal do fórum consegui montar minha planilha de alterações de log,mais tive um problema quando aba log registra 64 alterações para de gravar.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("c")) Is Nothing Then
For iCol = 1 To Target.Columns.Count
Set iCell = Target(iRow, iCol)
Plan4.Range("E" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, -2)
Plan4.Range("F" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 0)
Plan4.Range("C" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = VBA.Environ("username")
Plan4.Range("B" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Now()
Plan4.Range("A" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = iCell.Address(0, 0)
Plan4.Range("D" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 7)
NowValue = Now
If iLogRow Mod 100 = 0 Then DoEvents
Next iCol
ElseIf Not Intersect(Target, Columns("F")) Is Nothing Then
For iCol = 1 To Target.Columns.Count
Set iCell = Target(iRow, iCol)
Plan4.Range("E" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, -2)
Plan4.Range("F" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 0)
Plan4.Range("C" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = VBA.Environ("username")
Plan4.Range("B" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Now()
Plan4.Range("A" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = iCell.Address(0, 0)
Plan4.Range("D" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 4)
NowValue = Now
If iLogRow Mod 100 = 0 Then DoEvents
Next iCol
ElseIf Not Intersect(Target, Columns("I")) Is Nothing Then
For iCol = 1 To Target.Columns.Count
Set iCell = Target(iRow, iCol)
Plan4.Range("E" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, -2)
Plan4.Range("F" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 0)
Plan4.Range("C" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = VBA.Environ("username")
Plan4.Range("B" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Now()
Plan4.Range("A" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = iCell.Address(0, 0)
Plan4.Range("D" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 1)
NowValue = Now
If iLogRow Mod 100 = 0 Then DoEvents
Next iCol
End If
End Sub
Por babdallas
#27111
Anexa a sua planilha, por favor. Facilita a compreensão.
Por babdallas
#27137
Veja se é isso oq quer.
Você não está autorizado a ver ou baixar esse anexo.
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