Dal codice sottostante vorrei si potesse eliminare la MsgBox che appare ogni qualvolta
si scorre un elenco convalida dati....
- Codice: Seleziona tutto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim PID As Long, R As Long, j As Long, N As Integer
If Target.Address = "$C$2" Then
ActiveSheet.Range("$A$15:$E$50").ClearContents
With Me
MsgBox "Polizza # = " & .Range("C2").Value _
& vbNewLine & _
"Database # = " & .Range("E2").Text
End With
PID = Cells(2, 5)
R = ActiveWorkbook.Sheets("Eventi").Cells(2, 3).End(xlDown).Row
For j = 2 To R
' PID
If ActiveWorkbook.Sheets("Eventi").Cells(j, 3) = PID Then
N = N + 1
' IDEvento
ActiveSheet.Cells(14 + N, 1) = ActiveWorkbook.Sheets("Eventi").Cells(j, 1)
' Data
ActiveSheet.Cells(14 + N, 2) = ActiveWorkbook.Sheets("Eventi").Cells(j, 2)
' Premio
ActiveSheet.Cells(14 + N, 3) = ActiveWorkbook.Sheets("Eventi").Cells(j, 4)
' Annotazioni
ActiveSheet.Cells(14 + N, 4) = ActiveWorkbook.Sheets("Eventi").Cells(j, 5)
' DocumentoWordExcel
ActiveSheet.Cells(14 + N, 5) = ActiveWorkbook.Sheets("Eventi").Cells(j, 6)
If ActiveWorkbook.Sheets("Eventi").Cells(j, 6).HasFormula Then
ActiveSheet.Cells(14 + N, 5).Formula = ActiveWorkbook.Sheets("Eventi").Cells(j, 6).Formula
End If
With ActiveSheet.Range(Cells(14 + N, 2), Cells(14 + N, 5))
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End If
ActiveSheet.Range("$B$15:$B$30").NumberFormat = "m/d/yyyy"
Next
End If
End Sub
Vi ringrazio anticipatamente per l'aiuto.
fastbike73