Web query research saving

E

eddie1

Hi there

I'm really a Newbie of VBA .



I would like to build a database, which keep record of value an
releated time from a web query value, which is being updating every
mins .



I attach what I did ( .... just for laughing)

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 Then
ThisRow = Target.Row
If Target.Text > " " Then
Range("C" & ThisRow).Copy
Range("D" & ThisRow).PasteSpecial xlPasteValues
End If
End If
End Sub


Thank
 
D

Don Guillett

you might like this better
If target.row >2 and Target.Column = 3 Then
x=cells(rows.count,"d").end(xlup).row+1
Range("D" & x)=range("C" & target.row)
End If
End Sub
 
E

eddie1

Don

Thank you very much indeed.

But still some problem ....



Actually string is the result of formula:
IF(B15=A$9;query!B$6;" ") ==> column C

and it has to be save in next cell ==> column D.

So that if I input a value myself , no problem but with the abov
formula it does not work .....




:confused
 
E

eddie1

Don

Thank you very much indeed.

But still some problem ....



Actually string is the result of formula:
IF(B15=A$9;query!B$6;" ") ==> column C

and it has to be save in next cell ==> column D.

So that if I input a value myself , no problem but with the above
formula it does not work .....




:confused:
 
D

Dave Peterson

There's another worksheet event that you could try: Worksheet_Calculate.

This just copies the value from column C to column D with each calcuation:

Option Explicit
Private Sub Worksheet_Calculate()
Dim myRng As Range

Set myRng = Intersect(Me.UsedRange, Me.Range("C:C"))
With myRng
Application.EnableEvents = False
.Offset(0, 1).Value = .Value
Application.EnableEvents = True
End With

End Sub
 
Top