Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
- 'Code that needs to be run for the piece
- 'Code to handle picking macro to run for the piece
- 'NOTE this is and an event not a macro
- 'Before double click ........blablabla
- If ActiveCell.Column > 9 Then
- If ActiveCell.Column < 18 Then
- If ActiveCell.Row < 9 Then
- If ActiveCell.Value <> "" Then
- If Cells(1, 1).Value = 1 Then
- Cells(1, 2).Value = ActiveCell.Row
- Cells(1, 3).Value = ActiveCell.Column
- End If
- End If
- '*******test if it works if not use code:*******
- 'Target.Value = Target
- Select Case Target.Value
- Case "W" 'a normal white piece
- If Cells(1, 1).Value = 1 Then
- Range("J21:Q28").Clear
- Call NormalWhitePiece
- Cells(1, 1).Value = 2
- End If
- Case "W*" 'a kinged white piece
- If Cells(1, 1).Value = 1 Then
- Range("J21:Q28").Clear
- Call KingedWhitePiece
- Cells(1, 1).Value = 2
- End If
- Case "B" 'a normal black piece
- If Cells(1, 1).Value = 1 Then
- Range("J21:Q28").Clear
- Call NormalBlackPiece
- Cells(1, 1).Value = 2
- End If
- Case "B*" 'kinged black piece
- If Cells(1, 1).Value = 1 Then
- Range("J21:Q28").Clear
- Call KingedBlackPiece
- Cells(1, 1).Value = 2
- End If
- Case "" 'A blank Space
- If Cells(1, 1).Value = 2 Then
- Call MoveToLocation
- Cells(1, 1).Value = 1
- End If
- End Select
- End If
- End If
- End If
- EndOf:
- 'End of code handling macro selection
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement