Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
visual basic
bonjour à tous,
est-ce que quelqu'un pourrait m'aider concernant un programme visual basic.Mon soucis est le suivant:lorsque je rentre une lettre dans une cellule, cette cellule se colore dans une couleur déterminée suivant la lettre.jusque là pas de problème.Mon soucis arrive quand ma 2ème cellule doit-être égale à la 1è la lettre se reporte bien , mais pas la couleur. Ci dessous le programme que j'utilise Merci par avance de votre aide Private Sub Worksheet_Change(ByVal Target As Range) Dim c As Range If Not Intersect(Target.Cells, Range("B5", ["AF208"])) Is Nothing Then For Each c In Target Select Case c.Value Case "AM": c.Interior.ColorIndex = 3 Case "AT": c.Interior.ColorIndex = 3 Case "M": c.Interior.ColorIndex = 20 Case "FM": c.Interior.ColorIndex = 20 Case "FMO": c.Interior.ColorIndex = 20 Case "N": c.Interior.ColorIndex = 37 Case "FN": c.Interior.ColorIndex = 37 Case "S": c.Interior.ColorIndex = 38 Case "FS": c.Interior.ColorIndex = 38 Case "FSO": c.Interior.ColorIndex = 38 Case "J": c.Interior.ColorIndex = 19 Case "FJO": c.Interior.ColorIndex = 19 Case "R": c.Interior.ColorIndex = 35 Case "FR": c.Interior.ColorIndex = 35 Case "CP": c.Interior.ColorIndex = 35 Case "F": c.Interior.ColorIndex = 24 Case "EM": c.Interior.ColorIndex = 40 Case "CPA": c.Interior.ColorIndex = 40 Case "MA": c.Interior.ColorIndex = 40 Case "NA": c.Interior.ColorIndex = 40 Case "B": c.Interior.ColorIndex = 40 Case "D": c.Interior.ColorIndex = 40 Case "H": c.Interior.ColorIndex = 40 Case "DE": c.Interior.ColorIndex = 40 Case Else: c.Interior.ColorIndex = xlNone End Select Next End If End Sub -- Katia , Fred & Valentin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic | Excel Discussion (Misc queries) | |||
Is Visual Basic the same as Visual Studio 2008? | Excel Worksheet Functions | |||
changing the visual basic in office 2003 to visual studio net | Excel Discussion (Misc queries) | |||
Visual Basic | Excel Discussion (Misc queries) | |||
Very visual basic | Excel Programming |