Login Registrati
Stai vedendo 5 articoli - dal 1 a 5 (di 5 totali)
  • Autore
    Articoli
  • #28512 Score: 0 | Risposta

    AmmoN
    Partecipante

      buongiorno

      ho un userform che mi inserisce dei dati sul foglio.

      nell'attesa del caricamento apre un altro userform dove cìè un alabel con scritto "ATTENDERE PREGO". il problema è che quando si apre si vede solomante un rettangolo grigio con la scritta caption in alto..è come se il caricamento dell'userform di attesa si bloccasse.

      come posso risolvere? qst il codice

      commandbutton1 è il pulsante della userform che mi inserisc i dati

      userform2 è quello di attesa

       

      Private Sub CommandButton1_Click()
      Application.ScreenUpdating = False
      userform2.Show vbModeless
      Dim iRow As Long
      
      
      
      'mia macro
      
      
      
      Unload Me
      
      
       Application.Wait Now + TimeSerial(0, 0, 5)
      Unload userform2
          
        
      MsgBox ("Dati inseriti correttamente.")
      
      Application.ScreenUpdating = True
      
      End Sub

       

       

      #28523 Score: 0 | Risposta

      patel
      Moderatore
        51 pts

        Non è questo il modo di procedere, Application.Wait ferma l'esecuzione, ti allego un esempio da adattare, al posto del ciclo FOR metti il tuo codice

        Allegati:
        You must be logged in to view attached files.
        #28525 Score: 0 | Risposta

        AmmoN
        Partecipante

          se non ho capito male( ma credo proprio di si) dovrei inserire qst codice 

          Dim tempo As Single
          For A = 1 To 100
               For X = 1 To 1000000
               Next X
               tempo = tempo + 1
               UpdateProgressBar tempo
          Next

           

          nella mia macro?

          Private Sub CommandButton1_Click()
          Application.ScreenUpdating = False
          
          Dim iRow As Long
          Dim tempo As Single
          For A = 1 To 100
               For X = 1 To 1000000
               Next X
               tempo = tempo + 1
               UpdateProgressBar tempo
          Next
          userform2.Show vbModeless
          
          'mia macro
          
          
          
          Unload Me
          
          
           Application.Wait Now + TimeSerial(0, 0, 5)
          Unload userform2
              
            
          MsgBox ("Dati inseriti correttamente.")
          
          Application.ScreenUpdating = True
          
          End Sub
          #28535 Score: 0 | Risposta

          patel
          Moderatore
            51 pts

            No, non così, ma non è chiaro cosa vuoi fare, allega un file di esempio e spiega meglio

            #28536 Score: 0 | Risposta

            AmmoN
            Partecipante

              all'avvio della macro dell'useform per modificare i dati  si aprisse un useform2 di attesa..

              qst la macro

              Private Sub CommandButton2_Click()
              
              
               userform2.Show    
              
              
              Application.ScreenUpdating = False
                  Dim tabella As Range
               With Foglio9
                      Set CellaInBassoASinistra = .Cells(.Rows.Count, 2).End(xlUp)
                      Set CellaInAltoADestra = .Range("f2")
                  End With
                  Set tabella = Range(CellaInBassoASinistra, CellaInAltoADestra)
               
                  Dim record As Range
                      If Me.CommandButton2.Caption = "AGGIUNGI VOCE" Then
                      Set record = tabella.Rows(tabella.Rows.Count).Offset(1, 0)
                  Else
                      Set record = tabella.Rows(Me.nominativo.ListIndex + 1)
                      End If   
                  With record
                      .Cells(1) = Me.qualifica
                      .Cells(2) = Me.nominativo
                      .Cells(3) = Me.destinazione
                      .Cells(4) = Me.data
                      .Cells(5) = Me.dataal
                  End With
              
              
              Unload userform2  
              
              
                   MsgBox ("Dati modificati correttamente.")
               Sheets("TURNI").Select
                  Range("A1").Select
                  Unload Me
              Application.ScreenUpdating = True
              End Sub

               

            Login Registrati
            Stai vedendo 5 articoli - dal 1 a 5 (di 5 totali)
            Rispondi a: USERFORM ATTESA
            Gli allegati sono permessi solo ad utenti REGISTRATI
            Le tue informazioni: