![]() |
|
Forum
|
|
|
#1 (permalink) |
|
XLDnaute Nouveau
Date d'inscription: janvier 2008
Messages: 1
|
Bonjour, en passant par
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActivLigne = 0 Then ActivLigne = ActiveCell.Row Cells(ActivLigne, 3).Interior.Color = RGB(255, 255, 255): Cells(ActivLigne, 35).Interior.Color = RGB(255, 255, 255) Cells(ActiveCell.Row, 3).Interior.Color = RGB(0, 255, 0): Cells(ActiveCell.Row, 35).Interior.Color = RGB(0, 255, 0) ActivLigne = ActiveCell.Row End Sub je ne peu plus copier/coller avec Ctrl-V et plus avec la souris clic droit. Avec le presse papier ouvert celà fonctionne, donc il l'enregistre mais ne me le redonne pas automatiquement. Merci de votre aide Francis |
|
|
|
|
|
#2 (permalink) |
|
XLDnaute Barbatruc
Date d'inscription: juin 2005
Localisation: RENNES
Version Excel : Excel 2000 (PC)
Messages: 6 714
|
Bonsoir
Je ne comprends pas cette ligne dans ton code initial. If ActivLigne = 0 Then ActivLigne = ActiveCell.Row pourquoi ne pas employer ActivLigne=ActiveCell.Row ou ActivLigne=Target.Row 'Il n'y pas de ligne 0 donc ActivLigne ne peut égaler 0, non ? edit: nouvelle mouture Si j'ai bien compris ton code, je le simplifierai ainsi, Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Rows.Count > 1 And Target.Columns.Count > 1 Then Exit Sub Target.Interior.Color = _ IIf(Target.Row = 0, RGB(255, 255, 255), RGB(0, 255, 0)) Cells(Target.Row, 35).Interior.Color = IIf(Target.Row = 0, RGB(255, 255, 255), RGB(0, 255, 0)) End Sub
__________________
Cordialement, __________________ JM AddictDernière modification par Staple1600 ; 26/01/2008 à 23h06. |
|
|
|
| ANNONCES | |
![]() |
| Liens sociaux |
| Outils de la discussion | |
|
|
Discussions similaires
|
||||
| Discussion | Auteur | Forum | Réponses | Dernier message |
| VBA GESTION DU PRESSE PAPIER | os_rouen | Forum Excel | 5 | 04/11/2005 11h15 |
| presse papier | Pyrof | Forum Excel | 3 | 12/10/2005 11h48 |
| Lire le presse papier... | bigbig | Forum Excel | 7 | 18/05/2005 17h17 |
| message du presse papier | JM | Forum Excel | 4 | 06/04/2005 13h34 |
| Vider presse papier | sergio | Forum Excel Downloads - Archives | 2 | 09/08/2002 20h32 |