- Tenho esse código em VBA :
[code=vb.net]Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim wsHist As Worksheet, Rng As Range
Set wsHist = Sheets("Historico")
If Sh Is wsHist Then Exit Sub
Set Rng = wsHist.Range("A" & Rows.Count).End(xlUp).Offset(1)
With Rng
.Value = Now
.Offset(, 1) = Sh.Name
.Offset(, 2) = Target.Address
.Offset(, 3) = atual
If Target.Cells.Count > 1 Then
.Offset(, 4) = "Valores Alterados"
Else
.Offset(, 4) = Target.Formula
End If
End With
End Sub[/code]
Dim wsHist As Worksheet, Rng As Range
Set wsHist = Sheets("Historico")
If Sh Is wsHist Then Exit Sub
Set Rng = wsHist.Range("A" & Rows.Count).End(xlUp).Offset(1)
With Rng
.Value = Now
.Offset(, 1) = Sh.Name
.Offset(, 2) = Target.Address
.Offset(, 3) = atual
If Target.Cells.Count > 1 Then
.Offset(, 4) = "Valores Alterados"
Else
.Offset(, 4) = Target.Formula
End If
End With
End Sub[/code]
- Queria transformar em javascript para colocar na Planilhas do Google ,mas eu não sei javascript (OBS: o que estou precisando e ter o valor da celula antes dela ser alterada, pois irei gravar no historio o VALOR ANTERIOR e o VALOR NOVO que a célula vai ter.)