Excel cell changes question

Please post any questions regarding the program here.

Moderator: 2020vision

Excel cell changes question

Postby doris_day » Wed May 06, 2009 12:44 pm

I want to be able to show in one cell changes in another cell due to a refresh. For instance, say cell B5 has 3.0 in it and then on a refresh this changes to 3.2, I would like C5 (say) to show 0.2 i.e the change from 3.0 to 3.2. If on the next refresh the cell changed from 3.2 to 3.0 again, cell C5 should show -0.2.
I'm sure there must be a simple function for this so any help would be appreciated.
User avatar
doris_day
 
Posts: 967
Joined: Fri Nov 02, 2007 12:34 am

Postby Roger » Wed May 06, 2009 1:30 pm

I think you need to use VBA to do this.
Roger
 
Posts: 140
Joined: Fri Nov 18, 2005 10:45 pm

Postby doris_day » Wed May 06, 2009 1:36 pm

Would you have an example of the code I'd need to write ?
User avatar
doris_day
 
Posts: 967
Joined: Fri Nov 02, 2007 12:34 am

Postby alrodopial » Wed May 06, 2009 3:31 pm

Can you change the code given here?

http://gruss-software.co.uk/forum/viewtopic.php?t=3265
alrodopial
 
Posts: 1355
Joined: Wed Dec 06, 2006 9:59 pm

Postby doris_day » Wed May 06, 2009 4:11 pm

Thanks. I'll take a closer look but it seems that this code records the data but I only need to know the change from one refresh to another. But if I look closer I may be able to adapt it.
Thanks for the idea.
User avatar
doris_day
 
Posts: 967
Joined: Fri Nov 02, 2007 12:34 am

Postby Roger » Wed May 06, 2009 5:11 pm

Sorry I only really knew it couldn't be done with formulas.
Roger
 
Posts: 140
Joined: Fri Nov 18, 2005 10:45 pm

Postby alrodopial » Wed May 06, 2009 6:28 pm

Copy paste the below in VBA-Sheet1 (top left in VBA editor) (not module).
It records the value from cell C5 in sheet1 at cell D5-sheet1 and places their difference in E10 in sheet2.You must log prices from BA into sheet1.
Not tested.
Change the cells as you wish.

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
   
    If Target.Columns.Count = 16 Then
       
        Application.EnableEvents = False
       
        CurrentPRICE = Sheets("Sheet1").Range("C5").Value
        PreviusPRICE = Sheets("Sheet1").Range("D5").Value
       
        Sheets("sheet2").Range("E10") = CurrentPRICE - PreviusPRICE
       
        'Store the current price for next refresh - calculation
        Sheets("sheet1").Range("D5") = Sheets("sheet1").Range("C5")
       
        Application.EnableEvents = True
       
    End If
   
alrodopial
 
Posts: 1355
Joined: Wed Dec 06, 2006 9:59 pm

Postby doris_day » Wed May 06, 2009 7:20 pm

Thanks for that. For some strange reason, and possibly because I have data being read from 2 tabs in BA which go to Sheet 1 and Sheet 2, after I've done the VBA stuff, it doesnt seem to recognise Sheet 1 in BA at all, so I cant route any data to it. I've changed all the relevant cell names of course but I'll have a futher play a little later on.
Any ideas ?
User avatar
doris_day
 
Posts: 967
Joined: Fri Nov 02, 2007 12:34 am

Postby alrodopial » Wed May 06, 2009 8:47 pm

alrodopial
 
Posts: 1355
Joined: Wed Dec 06, 2006 9:59 pm

Postby doris_day » Fri May 08, 2009 5:56 am

Thanks for that. Yes, your file seems to work fine, even after changing cells etc. There must be some VBA conflict in my worksheet somewhere that I'm looking into. If I cant get round it, I'll rebuild a worksheet around yours.
Thanks v much as this has shown me what I need to do.
This is how a good forum should work !
User avatar
doris_day
 
Posts: 967
Joined: Fri Nov 02, 2007 12:34 am


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 99 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.