Cell Update only at a specific time.

S

Scott520

I have a clock running in Excel. Data in one cell is constantly changing. At
a specific time which I specify in a cell, I want the value in the cell that
is constantly changing, snapshot in another cell. How do I do this?
For example, stock prices, they are constantly changing on my spreadsheet
being linked to the internet, at 10:30 I want the price of IBM in a specific
cell.
 
L

Luke M

As you have a clock, I'm assuming you're using some type of VBA/macro. You
should be able to stick this snippet into the appropriate place in your code
(after it updates cell)

'A1 is your clock cell
'A2 is your fluctuating price cell
'A3 is "snapshot" cell
If Range("A1").Value = TimeValue("10:30") Then
Range("A3").Value = Range("A2").Value
End If
 
S

Scott520

I do not have a VB Macro. I am obtaining this clock update from the internet,
a web page. I am trying to avoid writing a Macro since I have limited
experience with them.
 
L

Luke M

I'm afraid for what you want, a macro is inevitable. But fear not, its fairly
simple to put in.

Right click on your sheet tab containing your clock. Click "view code".
Paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
'A1 is your clock cell
'A2 is your fluctuating price cell
'A3 is "snapshot" cell
'Change references as appropriate
If Target = Range("A1") Then
'Activates everytime target changes
If Range("A1").Value = TimeValue("10:30") Then
Range("A3").Value = Range("A2").Value
End If
End If
End Sub

Close the Visual Base Editor, and save. You're good to go now!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top