Moderator: 2020vision
by MartinP_uk » Sat Mar 13, 2010 9:39 am
by 2020vision » Sun Mar 14, 2010 1:32 pm
by MartinP_uk » Sun Mar 14, 2010 10:47 pm
by MartinP_uk » Thu Mar 18, 2010 8:58 pm
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
End Sub
by MartinP_uk » Thu Mar 18, 2010 9:07 pm
If Target.Columns.Count <> 16 Then Exit Sub
by osknows » Thu Mar 18, 2010 10:03 pm
by osknows » Thu Mar 18, 2010 10:14 pm
MartinP_uk wrote:I have managed to scrape together this piece of code that copies the contents of Y5:Y50 into the next column. How would it be possible to then past Y5:Y50 into the next available column every time Betting Assistant refreshes? i.e every 2 secs.
- Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
Application.EnableEvents = False
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
End Sub
by MartinP_uk » Thu Mar 18, 2010 10:20 pm
osknows wrote:MartinP_uk wrote:I have managed to scrape together this piece of code that copies the contents of Y5:Y50 into the next column. How would it be possible to then past Y5:Y50 into the next available column every time Betting Assistant refreshes? i.e every 2 secs.
- Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
End Sub
Your code works fine I think, the only problem is you have disabled events using 'Application.EnableEvents = False' and not enabled them again
try this
- Code: Select all
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
Application.EnableEvents = False
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
End Sub
by osknows » Thu Mar 18, 2010 10:22 pm
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NextCol As Long
If Target.Columns.Count <> 16 Then Exit Sub
NextCol = Cells(Target.Row, Columns.Count).End(xlToLeft).Column + 1
Application.EnableEvents = False
Range("Y5:Y50").Copy
Cells(5, NextCol).PasteSpecial Paste:=xlPasteValues
Application.EnableEvents = True
End Sub
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.