PDA

View Full Version : Solved: Glitch in Macro



coliervile
05-14-2008, 05:12 AM
This coding was provided by "XLD", thanks Bob. Follow this VBAExpress thread http://www.vbaexpress.com/forum/showthread.php?t=18645 to get an idea of what the coding is suppose to do. The glitch comes up when player 3's number, 33, is entered into cell C29. The number 33 should've gone into cell N36, but instead it went into cell AO37. What is odd is that players 1 and 2 numbers went into their correct cells and the rest of the coding seems to be working correctly. It's "My Bad" for not checking the original coding in the attached VBAExpress thread that Bob provided. The error with the coding shows up in the original thread too.

Best regards,

Charlie

coliervile
05-15-2008, 04:01 AM
Does anyone have an idea of why this glitch is happening??? I would greatly appreciate anyones help with this.

Best regards,

Charlie

coliervile
05-15-2008, 01:22 PM
:dunno I tried the macro on a new workbook/worksheet and the same thing happens... after the second player's information the third player's first number goes into the second player's information. This is really frustrating... :banghead:

Best regards,

Charlie

coliervile
05-15-2008, 05:34 PM
If there'a no solution to the current glitch in this macro is there another macro that can do what I need it to do???

Best regards,

Charlie

coliervile
05-16-2008, 05:38 AM
It doesn't seem like there's a solution to this macro glitch. I'm going to start a new thread to readdress what I need in this particular macro.

Best regards to all,

Charlie

Bob Phillips
05-16-2008, 06:01 AM
Does this do it



Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "C10:C117"
Dim mpStart As Range

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then

With Target

If .Row > 10 And .Row < 118 And .Row Mod 9 <> 1 Then

Set mpStart = Range("F" & (.Row \ 9 + 1) * 9)
End If

For i = 1 To 9

If mpStart.Offset(0, (i - 1) * 9 + 8).Value = "" Then

mpStart.Offset(0, (i - 1) * 9 + 8).Value = Target.Value
Exit For
End If
Next i
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

coliervile
05-16-2008, 02:48 PM
Bob thanks for your suggestion. Along with your idea I had to make a couple of others and I think it now works like I want it to. Thanks again.

Bob Phillips
05-16-2008, 03:02 PM
I can't see any changes to Sheet1, and still doesn't work properly.

I get a compile error on ScoreCard (2).

I can't see the changes I suggested, so what have you done?

Don't you also need some delete code, shunt the data along if a value is cleared.

coliervile
05-16-2008, 03:10 PM
Let's try this one..

Bob Phillips
05-16-2008, 03:21 PM
So did you see my other suggestion?

coliervile
05-16-2008, 03:32 PM
Are you referring to this???
Don't you also need some delete code, shunt the data along if a value is cleared.

Best regards,

Charlie

coliervile
05-16-2008, 04:12 PM
Bob I'm always interested in hearing your thoughts on improving something.

Bob Phillips
05-17-2008, 12:35 AM
That's the one.

coliervile
05-17-2008, 01:07 AM
The player's number would only appear if they were in the game and batting. If I needed to remove a player's number I have a clear contents macro in a toolbar that I can use.

coliervile
05-17-2008, 01:07 AM
The player's number would only appear if they were in the game and batting. If I needed to remove a player's number I have a clear contents macro in a toolbar that I can use.

Bob Phillips
05-17-2008, 01:38 AM
OK, just a thought. I certainly needed it when I was testing the code yesterday.

coliervile
05-17-2008, 01:49 AM
Bob if you still have the coding I'll take a look at it?