VBA question

Please post any questions regarding the program here.

Moderator: 2020vision

VBA question

Postby Ferru123 » Sun Feb 18, 2018 8:39 pm

I have a macro that copies the value 1 from cells in the EK column to the adjacent cell in the EL column:

Dim b As Integer

For b = 5 To 35

If Range("EK" & b).Value = 1 Then Range("EL" & b).Value = 1

Next b


When I enter a new market, I clear the column through the command Range("EL5:EL35").Value = "".

The challenge I have is that, when the value of (say) EK5 ceases to be 1, then the value of EL5 changes too.

I don't understand this. Can anyone help please?

Thanks

Jeff
Ferru123
 
Posts: 87
Joined: Sat Feb 21, 2009 1:28 pm

Re: VBA question

Postby Ferru123 » Sun Feb 18, 2018 8:47 pm

CORRECTION: What is happening is that the macro is copying from EK5 to EL5, but if (say) the value of EK6 becomes 1, then that figure won't be copied across to EL6.

Jeff
Ferru123
 
Posts: 87
Joined: Sat Feb 21, 2009 1:28 pm

Re: VBA question

Postby Captain Sensible » Mon Feb 19, 2018 12:55 pm

The code snippet you posted is simple enough so my bet is any 'errrors' you're having are more likely to be due to the order of when you're firing the code rather than the code.

No idea if your code uses data from other sheets maybe it's switched focus to another sheet, that's why it's always best to fully reference any cells rather than leave them as range(A1).value change to Worksheets("Sheet1").range(A1). value etc
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm


Return to Help

Who is online

Users browsing this forum: Majestic-12 [Bot] and 28 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.