Condividi:        

Eliminare MsgBox

Vuoi potenziare i tuoi documenti Word? Non sai come si fa una macro in Excel? Devi creare una presentazione in PowerPoint?
Oppure sei passato a OpenOffice e non sei sicuro di come lavorare al meglio?

Moderatori: Anthony47, Flash30005

Eliminare MsgBox

Postdi fastbike73 » 12/05/17 09:21

Buongiorno a tutti e ben ritrovati, era da tanto che non chiedevo aiuto al forum...
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
fastbike73
Win 10 & Office365
Filemaker Pro v. 13
fastbike73
Utente Senior
 
Post: 256
Iscritto il: 23/04/14 10:54

Sponsor
 

Re: Eliminare MsgBox

Postdi Marius44 » 12/05/17 12:05

Ciao
ritengo sia sufficiente eliminare (meglio se metti un apostrofo davanti ad ogni riga) queste righe di codice
Codice: Seleziona tutto
  With Me
    MsgBox "Polizza # = " & .Range("C2").Value _
       & vbNewLine & _
       "Database # = " & .Range("E2").Text
  End With


Ciao,
Mario
Marius44
Utente Senior
 
Post: 655
Iscritto il: 07/09/15 22:00

Re: Eliminare MsgBox

Postdi fastbike73 » 12/05/17 13:47

Grazie Mario, a buon rendere.
fastbike73
Win 10 & Office365
Filemaker Pro v. 13
fastbike73
Utente Senior
 
Post: 256
Iscritto il: 23/04/14 10:54


Torna a Applicazioni Office Windows


Topic correlati a "Eliminare MsgBox":


Chi c’è in linea

Visitano il forum: Nessuno e 39 ospiti