ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Updating from Webpage (https://www.excelbanter.com/excel-programming/444908-updating-webpage.html)

Peter Andrews[_3_]

Updating from Webpage
 
Excel 2007 (Home Edition)

I'm obtaining data from a webpage, however the following works when I
manually update cell B3, but doesn't when the cell is updated automatically
by the "Get external data from web" function. Does the "Get external data
from web" function inhibit the Worksheet_Change facility? ...and, if so,
how do I make it work.

Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Address = "$b$3" Then
MsgBox "Hello World"

End If

End Sub


Many Thanks.


Jim Cone[_2_]

Updating from Webpage
 
The Change event doesn't occur when cells change during a recalculation.
That sounds like your situation. You could use the Calculate event instead.
That requires a formula similar to: =Today() in a cell on the sheet to force calculation.
Use code like this in the sheet module...
'---
Private vContent As Variant

Private Sub Worksheet_Calculate()
If vContent < Me.Range("B3").Value2 Then
MsgBox "hello world"
vContent = Me.Range("B3").Value2
End If
End Sub
'---
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Data Rows Excel add-in: Color rows, Delete rows, Insert rows)




"Peter Andrews"
wrote in message ...
Excel 2007 (Home Edition)

I'm obtaining data from a webpage, however the following works when I manually update cell B3,
but doesn't when the cell is updated automatically by the "Get external data from web" function.
Does the "Get external data from web" function inhibit the Worksheet_Change facility? ...and, if
so, how do I make it work.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$b$3" Then
MsgBox "Hello World"
End If
End Sub


Many Thanks.




Don Guillett[_2_]

Updating from Webpage
 
On Aug 30, 7:31*am, "Jim Cone" wrote:
The Change event doesn't occur when cells change during a recalculation.
That sounds like your situation. You could use the Calculate event instead.
That requires a formula similar to: =Today() in a cell on the sheet to force calculation.
Use code like this in the sheet module...
'---
Private vContent As Variant

Private Sub Worksheet_Calculate()
If vContent < Me.Range("B3").Value2 Then
* *MsgBox "hello world"
* *vContent = Me.Range("B3").Value2
End If
End Sub
'---
Jim Cone
Portland, Oregon USAhttp://www.mediafire.com/PrimitiveSoftware
(Data Rows Excel add-in: Color rows, Delete rows, Insert rows)

"Peter Andrews"
wrote in .. .



Excel 2007 (Home Edition)


I'm *obtaining data from a webpage, however the following works when I manually update cell B3,
but doesn't when the cell is updated automatically by the "Get external data from web" function.
Does the "Get external data from web" function inhibit the Worksheet_Change facility? *...and, if
so, how do I make it work.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$b$3" Then
MsgBox "Hello World"
End If
End Sub
Many Thanks.- Hide quoted text -


- Show quoted text -

Try
If Target.Address = Range("$b$3").Address Then


All times are GMT +1. The time now is 07:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com