MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Update a cell based on a DDE updated cell value

  Asked By: Don    Date: Aug 10    Category: MS Office    Views: 1165

I apologize for asking this question if it has been asked and
answered previously. I spent several hours searching the forum
archives and online for a solution.

Unfortunately, while I'm a pretty good excel user, I know nothing
about VBA programming, although I just order Excel VBA programming
for Dummies. What I need to do is to have a value that is updated
via a DDE link placed as a value in another cell at different
intervals throughout the day.


B1 thru Z1 = Header with the time I need the snapshoot
A2 = Contstantly updating value

So, at say 7:00am, which is B1, I want it to take the dynamic value
in A2 and place it in B2 and stay that way until the next day at
7:00am. At 7:30am, do the same thing, but place it in C2, etc....
throughout the day.

I've seen examples that are close to what I need with the Change
function in VBA, unfortunately, every change would provide way to
much information and I only need snapshots based on the time interval
I define in the headers.

Hopefully this made sense. Does anyone have or know of a solution
for this?



1 Answer Found

Answer #1    Answered By: Sophia Campbell     Answered On: Aug 10

I tried out something like what you are asking about with the Bloomberg DDE

I don't think you need vba  to do this. You just need to set the iterations
check box in the tools-options-calculation tab section. I will tell you the set
up of the sheet I have prepared. It just involves one function IF.

My setup is this way 'This is not VBA code

Cell A1 = DDE(TIME) 'This is the time  input available from your DDE server or
from your own timer.

Cell A2 = DDE(Quote) ' This cell  contains the data which is obtained from the
DDE Server. This is the constant updating  value.

According to your message your intervals are placed in Horizontal format from
B1 to Z1. No Problem.

In The Cell B2 Enter this function.


Drag this function to the right upto Z1.

Suppose your intervals are 7:00, 7:30, 8:00, 8:30 etc then what this function
will do is compare your time interval with the DDE Time. If it is less than or
equal to 7:00 then the value in B2 will reflect the value at 7:00 (it will make
a copy of the value in the A1). Once the time crosses over into 7:01 then the
next cell C2 gets updated  till it reaches 7:30 but hte value in B2 will remain
the same as the value which was present at 7:00. Do not worry it will not
change. This is the property of the Excel iteration function.

I hope this helps you. This is the most simplest way to solve the problem. You
will need VBA only just to automatically save your work or make a copy of your
work into another workbook or worksheet.

Didn't find what you were looking for? Find more on Update a cell based on a DDE updated cell value Or get search suggestion and latest updates.