Consulting

Results 1 to 2 of 2

Thread: Solved: Recording changes in values

  1. #1
    VBAX Regular
    Joined
    Nov 2007
    Posts
    29
    Location

    Solved: Recording changes in values

    Please refer to the attachment.

    This is a sequence of values over a time period. Ignore the figures in the centre columns.

    As you can see, the figures either side of the columns vary over time. For example, the change on the previous in the top right figure in red is ?5. Values can also increase ? first figure in left column has gone from 82 t0 184 (+182).

    Is it possible to determine a change in a cell?s value from its previous value (and inserted to the next column ? left/right)?

    Presumably this would entail ?remembering? or temporarily retaining - I have seen this directly in Excel but can?t remember the details.

    I have included part of the code below if it helps.

    There is a related, but separate, question which I will post in due course.

    Any suggestions greatly appreciated.

    Grant.


    Else
    Buy1 = .FeedFields(FFBuy1): BidSize = .FeedFields(FFBidSize)
    Sale1 = .FeedFields(FFSell1): AskSize = .FeedFields(FFAskSize)
    '---
    ExcelDoc.Sheets(1).Cells(nRow, 3).Value = Buy1
    ExcelDoc.Sheets(1).Cells(nRow, 4).Value = Sale1
    ExcelDoc.Sheets(1).Cells(nRow, 5).Value = BidSize
    ExcelDoc.Sheets(1).Cells(nRow, 6).Value = AskSize
    ExcelDoc.Sheets(1).Cells(nRow, 7).Value = .Close(0, Data)
    ExcelDoc.Sheets(1).Cells(nRow, 8).Value = .Volume(0, Data)
    '---
    ExcelDoc.Sheets(1).Cells(13, 14).Value = BidSize 'Bid volume
    ExcelDoc.Sheets(1).Cells(14, 14).Value = .LimitVol(2, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(15, 14).Value = .LimitVol(3, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(16, 14).Value = .LimitVol(4, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(17, 14).Value = .LimitVol(5, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(18, 14).Value = .LimitVol(6, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(19, 14).Value = .LimitVol(7, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(20, 14).Value = .LimitVol(8, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(21, 14).Value = .LimitVol(9, osBuy, 0, Data)
    ExcelDoc.Sheets(1).Cells(22, 14).Value = .LimitVol(10, osBuy, 0, Data)

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That would be done by using change event code, but that would be within Excel, not from within some automation as yours seems to be.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •