Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    colorize cell if... (2000 sr 1)

    I have this code...
    During the import how to controll if MATRICOLA is into range of sheet OPERATORI refered the column D and if nbnot in ragecolorize ceel with color 8...
    Example:
    In sheet IMPORT(OUT) MATRICOLA assume OI25418 (read the refered value in A, in this case 4502) this value not is present into range of column D and column G of sheet OPERATORI colorize cell F23 with color 8...

    Longish code moved to attachment by HansV

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: colorize cell if... (2000 sr 1)

    I don't see what column G in Operatori has to do with this.

    Do you mean that you want to compare column A in Import (Out) to column D in Operatori and column F in Import (Out) to column E in Operatori?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: colorize cell if... (2000 sr 1)

    sorry, you are right:-) column D and E

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: colorize cell if... (2000 sr 1)

    Your worksheet is protected, so it is impossible to change cell colors. If you want to do that, you must unprotect the worksheet.

    Place the following declaration at the beginning of the procedure:

    Dim rngFound As Range

    Below both instances of the line

    Range("F" & ORIZCELL.Row) = UCase(MATRICOLA)

    insert the following code:

    Set rngFound = Worksheets("OPERATORI").Range("D").Find(What:=Range("A" & ORIZCELL.Row), LookIn:=xlValues, LookAt:=xlWhole)
    If rngFound Is Nothing Then
    Range("F" & ORIZCELL.Row).Interior.ColorIndex = 8
    Else
    Set rngFound = rngFound.Offset(0, 1).Resize(3, 1).Find(What:=Range("F" & ORIZCELL.Row), LookIn:=xlValues, LookAt:=xlWhole)
    If rngFound Is Nothing Then
    Range("F" & ORIZCELL.Row).Interior.ColorIndex = 8
    End If
    End If

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: colorize cell if... (2000 sr 1)

    TKS Hans...and sorry me
    But I would want to colorize MATRICOLA in sheet IMPORT(OUT) column F

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: colorize cell if... (2000 sr 1)

    Doesn't the code I posted do that?

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: colorize cell if... (2000 sr 1)

    Great! sorry for delay, now work.
    Tks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •