Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2361 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VBA] Plantage Excel avec Worksheet_Change

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[VBA] Plantage Excel avec Worksheet_Change

n°1932473
scaryfan
Apple Inside
Posté le 16-10-2009 à 14:41:14  profilanswer
 

:hello:  
 
Salut à tous !
 
J'ai un souci avec ce code :
 

Code :
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     'Stop
  3.     Application.ScreenUpdating = False
  4.     Dim XX1 As Single
  5.     Range("A65536" ).End(xlUp).Select
  6.     XX1 = ActiveCell.Row - 2
  7.     Range(Target.Address).Select
  8.     If Target.Row > 7 And Target.Row <= XX1 Then
  9.         If Target.Column = 8 Or Target.Column = 9 Or Target.Column = 10 Or Target.Column = 11 Or Target.Column = 12 Or Target.Column = 14 Then
  10.             If ActiveCell.Value = "" Then
  11.                 With Selection.Interior
  12.                     .ColorIndex = 0
  13.                     .Pattern = xlSolid
  14.                     .PatternColorIndex = xlAutomatic
  15.                 End With
  16.             Else
  17.                 With Selection.Interior
  18.                     .ColorIndex = 24
  19.                     .Pattern = xlSolid
  20.                     .PatternColorIndex = xlAutomatic
  21.                 End With
  22.             End If
  23.         End If
  24.     End If
  25.     If ActiveCell.Value <> "" Then
  26.         ActiveCell.Offset(1, 0).Select
  27.     End If
  28. End Sub


 
je le traduis :
si je tape une valeur dans une cellule qui se trouve entre la 8ème et denière ligne de mon tableau et qui se trouve dans les colonnes 8, 9, 10, 11, 12 ou 14, le fonds de ma cellule change
si j'efface ce qu'il y a dans la cellule, le fonds se réinitialise...
 
ça marche très très bien... pas de souci...
 
par contre, quand je sélectionne une ligne du tableau en entier et que je la supprime, Excel reste figé...
 
quel est mon problème ?
 
;)


---------------
iMac 4Ghz (fin 2015) RAM 16Go SSD 256Go SSD 2To
mood
Publicité
Posté le 16-10-2009 à 14:41:14  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  [VBA] Plantage Excel avec Worksheet_Change

 

Sujets relatifs
e-mailing Excel + ThunderbirdVBA racine carrée comment faire ?
Variable VBA VbscripMacro Excel pour ajouter en caractère dans les cellules.
Macro excel interrogeant un tableau par le nom de la colonne[Excel]Aide au Retour à l'Emploi
insertion image dans fichier excelproblème crash Excel 2000 après supression d'un onglet
VBA Stdev variable sharpe ratioPOI Excel IllegalStateException getOutputStream()
Plus de sujets relatifs à : [VBA] Plantage Excel avec Worksheet_Change


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR