Thread: C0dŁ !!!!
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default C0dŁ !!!!

This should be all you need. I noticed a later thread. It's always best to
stay in the ORIGINAL.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$B$4" Then Exit Sub

Application.EnableEvents = False
On Error GoTo CleanUp

with Sheets("sheet17")
x=.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
cells(x,1)=target
cells(x,2)=range("f4")
cells(x,3)=time
end with

CleanUp:
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"tommyboy " wrote in message
...
I have this code and works fine to update colum a with any new data in
b4

Private prev As Variant


Private Sub Worksheet_Calculate()
Static init As Boolean
Dim v As Variant

Application.EnableEvents = False
On Error GoTo CleanUp

v = Me.Range("B4").Value

If init And v < prev Then
Sheets("sheet17").Cells(Rows.Count, "A"). _
End(xlUp).Offset(1, 0).Value = v

prev = v

ElseIf Not init Then
init = True
prev = Range("B4").Value

End If

CleanUp:
Application.EnableEvents = True
End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$B$4" Then Exit Sub

Application.EnableEvents = False
On Error GoTo CleanUp

prev = Target.Value

Sheets("sheet17").Cells(Rows.Count, "A"). _
End(xlUp).Offset(1, 0).Value = prev

CleanUp:
Application.EnableEvents = True
End Sub

When updating colum A with new data is it possible to also update the
coresponding column B, with the curent data in F4 and update the
coresponding colum C with the current time.

I have looked at your code but cant see how to duplicate for otheer
lines


---
Message posted from
http://www.ExcelForum.com/