Moderatori: Anthony47, Flash30005
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myC As Range, ckArea As String, scanAr As Range
Dim myMatch, myCData
'=NON(VAL.NON.DISP(CERCA.VERT(E$4;FESTE;1;0)))
ckArea = "E8:IM32" '<<< L'area da controllare
Set scanAr = Application.Intersect(Target, Range(ckArea))
If Not scanAr Is Nothing Then
Application.ScreenUpdating = False
For Each myC In scanAr
myCData = CLng(Cells(4, myC.Column))
If Application.VLookup(myCData, Sheets("Festività").Range("FESTE"), 1) = myCData Then
myC.Interior.ColorIndex = 49
Else
myMatch = Application.Match(myC.Value, Range("E2:V2"), False)
If IsError(myMatch) Then
myC.Interior.ColorIndex = xlNone
Else
myC.Interior.ColorIndex = Range("E2").Cells(1, myMatch).Interior.ColorIndex
End If
End If
Next myC
Application.ScreenUpdating = False
End If
End Sub
Sub FormattAll()
Range("E8:IM32").Copy
Range("E8").PasteSpecial xlPasteValues
Application.CutCopyMode = False
Range("E8").Select
End Sub
Vuol dire che l'elenco deve partire con -1, che e' un numero inferiore a tutte le date che possono esserci sul foglio. Visto che hai gia' un elenco:e' necessario che la prima cella di questo "Nome" sia posta a -1 cosa vuol dire?
Ricordatene pero' quando aggiungi date nell'elenco.e' necessario che le date inserite siano in ordine crescente (come sono gia' adesso) ok
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myC As Range, ckArea As String, scanAr As Range
Dim myMatch, myCData
'
ckArea = "E8:IM32" '<<< L'area da controllare
Set scanAr = Application.Intersect(Target, Range(ckArea))
If Not scanAr Is Nothing Then
Application.ScreenUpdating = False
For Each myC In scanAr
myCData = CLng(Cells(4, myC.Column))
If Application.VLookup(myCData, Sheets("Festività").Range("FESTE"), 1) = myCData Then
myC.Interior.ColorIndex = 49
Else
myMatch = Application.Match(myC.Value, Range("E2:V2"), False)
If IsError(myMatch) Then
myC.Interior.ColorIndex = xlNone
Else
myC.Interior.ColorIndex = Range("E2").Cells(1, myMatch).Interior.ColorIndex
End If
End If
Application.EnableEvents = False
If UCase(myC.Value) = "RC" Then
Cells(2, "V").Copy
myC.PasteSpecial Paste:=xlPasteFormats
ElseIf UCase(Right(myC.Value, 3)) = "PER" Then
Cells(2, "G").Copy
myC.PasteSpecial xlPasteFormats
ElseIf UCase(Right(myC.Value, 1)) = "S" Then
Cells(2, "P").Copy
myC.PasteSpecial Paste:=xlPasteFormats
ElseIf UCase(Right(myC.Value, 2)) = "IN" Then
Cells(2, "T").Copy
myC.PasteSpecial Paste:=xlPasteFormats
End If
Application.EnableEvents = True
Application.CutCopyMode = False
Next myC
Application.ScreenUpdating = False
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myC As Range, ckArea As String, scanAr As Range
Dim myMatch, myCData
'
ckArea = "E8:IM32" '<<< L'area da controllare
Set scanAr = Application.Intersect(Target, Range(ckArea))
If Not scanAr Is Nothing Then
Application.ScreenUpdating = False
For Each myC In scanAr
myCData = CLng(Cells(4, myC.Column))
If Application.VLookup(myCData, Sheets("Festività").Range("FESTE"), 1) = myCData Then
myC.Interior.ColorIndex = 49
Else
myMatch = Application.Match(myC.Value, Range("E2:V2"), False)
If IsError(myMatch) Then
myC.Interior.ColorIndex = xlNone
Else
myC.Interior.ColorIndex = Range("E2").Cells(1, myMatch).Interior.ColorIndex
myC.Interior.Pattern = xlSolid
myC.Interior.PatternColorIndex = xlAutomatic
End If
End If
Application.EnableEvents = False
If UCase(myC.Value) = "RC" Then
Cells(2, "V").Copy
myC.PasteSpecial Paste:=xlPasteFormats
ElseIf UCase(Right(myC.Value, 3)) = "PER" Then
Cells(2, "G").Copy
myC.PasteSpecial xlPasteFormats
Selection.Font.Size = 14
ElseIf UCase(Right(myC.Value, 1)) = "S" Then
Cells(2, "P").Copy
myC.PasteSpecial Paste:=xlPasteFormats
Selection.Font.Size = 16
ElseIf UCase(Right(myC.Value, 2)) = "IN" Then
Cells(2, "T").Copy
myC.PasteSpecial Paste:=xlPasteFormats
Selection.Font.Size = 14
End If
Application.EnableEvents = True
Application.CutCopyMode = False
Next myC
Application.ScreenUpdating = False
End If
End Sub
Torna a Applicazioni Office Windows
Chiavetta usb - Problemi con il disinserimento Autore: mastino46 |
Forum: Reti, ADSL e wireless Risposte: 4 |
Problemi di stampa su carta adesiva lucida con Epson Et 2850 Autore: lukarello7 |
Forum: Discussioni Risposte: 5 |
Visitano il forum: Nessuno e 8 ospiti