Excel e gli applicativi Microsoft Office Scrivere in cella il contenuto di un file txt

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

    Fabio
    Partecipante

      Volevo evitare di porre questa domanda ma non so cosa mettere al posto di :

      SHEETS("NOME").RANGE("J11")= #1 ' NON SCRIVE

       

      Sub TROVA_NOME()
      Dim NumeroFIle As Integer
      INDIRIZZO = ActiveWorkbook.Path
      ' 1
      If Dir(INDIRIZZO & "\Lanciatore\1.LBDP") <> "" Then GoTo NOME_PARTITA_1
      NOME_PARTITA_1:
      If Dir(INDIRIZZO & "\Lanciatore\A") = "" Then: Exit Sub
      Open INDIRIZZO & "\Lanciatore\A" For Input As #1
      SHEETS("NOME").RANGE("J11")= #1 ' NON SCRIVE
      Close #1 'Chiusura File
      Exit Sub
      ' 2
      If Dir(INDIRIZZO & "\Lanciatore\B") <> "" Then GoTo NOME_PARTITA_2
      NOME_PARTITA_2:
      If Dir(INDIRIZZO & "\Lanciatore\B") = "" Then: Exit Sub
      Open INDIRIZZO & "\Lanciatore\2.LBDP" For Input As #1
      SHEETS("NOME").RANGE("J11")= #1 ' NON SCRIVE
      Close #1 'Chiusura File
      Exit Sub
      ' 3
      If Dir(INDIRIZZO & "\Lanciatore\C") <> "" Then GoTo NOME_PARTITA_3
      NOME_PARTITA_3:
      If Dir(INDIRIZZO & "\Lanciatore\C") = "" Then: Exit Sub
      Open INDIRIZZO & "\Lanciatore\3.LBDP" For Input As #1
      SHEETS("NOME").RANGE("J11")= #1 ' NON SCRIVE
      Close #1 'Chiusura File
      Exit Sub
      End Sub

      #4107 Score: 0 | Risposta

      Fabio
      Partecipante
        Avevo scritto la domanda bene!
        Sub TROVA_NOME()
        Dim NumeroFIle As Integer
        INDIRIZZO = ActiveWorkbook.Path
        ' 1
        If Dir(INDIRIZZO & "\Lanciatore\1.LBDP") <> "" Then GoTo NOME_PARTITA_1
        NOME_PARTITA_1:
        If Dir(INDIRIZZO & "\Lanciatore\A") = "" Then: Exit Sub
        Open INDIRIZZO & "\Lanciatore\A" For Input As #1
        SHEETS("NOME").RANGE("J11")= #1 ' NON SCRIVE
        Close #1 'Chiusura File
        Exit Sub
        ' 2
        If Dir(INDIRIZZO & "\Lanciatore\B") <> "" Then GoTo NOME_PARTITA_2
        NOME_PARTITA_2:
        If Dir(INDIRIZZO & "\Lanciatore\B") = "" Then: Exit Sub
        Open INDIRIZZO & "\Lanciatore\2.LBDP" For Input As #1
        SHEETS("NOME").RANGE("J11")= #1 ' NON SCRIVE
        Close #1 'Chiusura File
        Exit Sub
        ' 3
        If Dir(INDIRIZZO & "\Lanciatore\C") <> "" Then GoTo NOME_PARTITA_3
        NOME_PARTITA_3:
        If Dir(INDIRIZZO & "\Lanciatore\C") = "" Then: Exit Sub
        Open INDIRIZZO & "\Lanciatore\3.LBDP" For Input As #1
        SHEETS("NOME").RANGE("J11")= #1 ' NON SCRIVE
        Close #1 'Chiusura File
        Exit Sub
        End Sub
        #4108 Score: 0 | Risposta

        Fabio
        Partecipante
          La funzione incolla non funziona in questo sito!!
          Ho allegato il file...
          Allegati:
          You must be logged in to view attached files.
          #4111 Score: 0 | Risposta

          Fabio
            oltre all'errore ho confuso nelle celle ci devono andare A B C.
            #4114 Score: 0 | Risposta

            Fabio
               

              Sub TROVA_NOME()
              Dim NumeroFIle As Integer
              INDIRIZZO = ActiveWorkbook.Path
              ' 1
              If Dir(INDIRIZZO & "\Lanciatore\1.LBDP") <> "" Then GoTo NOME_PARTITA_1
              NOME_PARTITA_1:
              If Dir(INDIRIZZO & "\Lanciatore\A") = "" Then: Exit Sub
              Open INDIRIZZO & "\Lanciatore\A" For Input As #1
              
              ' scrivere in Sheets("NOME").Range("J11") contenuto file A
              
              Close #1 'Chiusura File
              Exit Sub
              ' 2
              If Dir(INDIRIZZO & "\Lanciatore\B") <> "" Then GoTo NOME_PARTITA_2
              NOME_PARTITA_2:
              If Dir(INDIRIZZO & "\Lanciatore\B") = "" Then: Exit Sub
              Open INDIRIZZO & "\Lanciatore\2.LBDP" For Input As #1
              
              ' scrivere in Sheets("NOME").Range("J11") contenuto file B
              
              Close #1 'Chiusura File
              Exit Sub
              ' 3
              If Dir(INDIRIZZO & "\Lanciatore\C") <> "" Then GoTo NOME_PARTITA_3
              NOME_PARTITA_3:
              If Dir(INDIRIZZO & "\Lanciatore\C") = "" Then: Exit Sub
              Open INDIRIZZO & "\Lanciatore\3.LBDP" For Input As #1
              
              ' scrivere in Sheets("NOME").Range("J11") contenuto file C
              
              Close #1 'Chiusura File
              Exit Sub
              End Sub​
              #4115 Score: 0 | Risposta

              Oscar
              Partecipante
                45 pts
                Cos'è sto romanzo
                #4116 Score: 0 | Risposta

                Fabio
                  Sub TROVA_NOME()
                  Dim NumeroFIle As Integer
                  INDIRIZZO = ActiveWorkbook.Path
                  ' 1
                  If Dir(INDIRIZZO & "\Lanciatore\1.LBDP") <> "" Then GoTo NOME_PARTITA_1
                  NOME_PARTITA_1:
                  If Dir(INDIRIZZO & "\Lanciatore\A") = "" Then: Exit Sub
                  Open INDIRIZZO & "\Lanciatore\A" For Input As #1
                  
                  ' scrivere in Sheets("NOME").Range("J11") contenuto file A
                  
                  Close #1 'Chiusura File
                  Exit Sub
                  ' 2
                  If Dir(INDIRIZZO & "\Lanciatore\2.LBDP") <> "" Then GoTo NOME_PARTITA_2
                  NOME_PARTITA_2:
                  If Dir(INDIRIZZO & "\Lanciatore\B") = "" Then: Exit Sub
                  Open INDIRIZZO & "\Lanciatore\B" For Input As #1
                  
                  ' scrivere in Sheets("NOME").Range("J11") contenuto file B
                  
                  Close #1 'Chiusura File
                  Exit Sub
                  ' 3
                  If Dir(INDIRIZZO & "\Lanciatore\3.LBDP") <> "" Then GoTo NOME_PARTITA_3
                  NOME_PARTITA_3:
                  If Dir(INDIRIZZO & "\Lanciatore\C") = "" Then: Exit Sub
                  Open INDIRIZZO & "\Lanciatore\C" For Input As #1
                  
                  ' scrivere in Sheets("NOME").Range("J11") contenuto file C
                  
                  Close #1 'Chiusura File
                  Exit Sub
                  End Sub
                  #4117 Score: 0 | Risposta

                  Fabio
                    Oscar sai rispondere!
                    Devo scrivere il contenuto di A B C nella cella J11 del foglio NOME.
                    #4119 Score: 0 | Risposta

                    Fabio
                       

                      Nei spazi vuoti mi servirebbe il codice per prelevare il testo del file ( A B C ) e incollarlo nella cella j11

                      Sub TROVA_NOME()
                      Dim NumeroFIle As Integer
                      INDIRIZZO = ActiveWorkbook.Path
                      ' 1
                      If Dir(INDIRIZZO & "\Lanciatore\1.LBDP") <> "" Then GoTo NOME_PARTITA_1 Else GoTo 2
                      NOME_PARTITA_1:
                      If Dir(INDIRIZZO & "\Lanciatore\A") = "" Then: Exit Sub
                      Open INDIRIZZO & "\Lanciatore\A" For Input As #1
                      
                      
                      
                      Close #1 'Chiusura File
                      Exit Sub
                      ' 2
                      2:
                      If Dir(INDIRIZZO & "\Lanciatore\B") <> "" Then GoTo NOME_PARTITA_2 Else GoTo 3
                      NOME_PARTITA_2:
                      If Dir(INDIRIZZO & "\Lanciatore\B") = "" Then: Exit Sub
                      Open INDIRIZZO & "\Lanciatore\2.LBDP" For Input As #1
                      
                      
                      
                      Close #1 'Chiusura File
                      Exit Sub
                      ' 3
                      3:
                      If Dir(INDIRIZZO & "\Lanciatore\C") <> "" Then GoTo NOME_PARTITA_3 Else GoTo ESCI
                      NOME_PARTITA_3:
                      If Dir(INDIRIZZO & "\Lanciatore\C") = "" Then: Exit Sub
                      Open INDIRIZZO & "\Lanciatore\3.LBDP" For Input As #1
                      
                      
                      
                      Close #1 'Chiusura File
                      ESCI:
                      Exit Sub​
                       
                      #4120 Score: 0 | Risposta

                      Fabio
                        Con questo forum è davvero impossibile inserire il codice non lo copia corretto è da rivedere.
                        #4122 Score: 0 | Risposta

                        Fabio
                          DOVREBBE ESSERE : PRINT#1, SHEETS("NOME").RANGE("J11")
                           
                          LA PROVO SUBITO...!
                          #4123 Score: 0 | Risposta

                          Fabio
                            Non funziona!
                            #4124 Score: 0 | Risposta

                            Fabio
                              Possibile che nessuno risponde
                              #4126 Score: 0 | Risposta

                              Fabio
                                Sub TROVA_NOME()
                                Dim NumeroFIle As Integer
                                INDIRIZZO = ActiveWorkbook.Path
                                ' 1
                                If Dir(INDIRIZZO & "\Lanciatore\1.LBDP") <> "" Then GoTo NOME_PARTITA_1 Else GoTo 2
                                NOME_PARTITA_1:
                                If Dir(INDIRIZZO & "\Lanciatore\A") = "" Then: Exit Sub
                                Open INDIRIZZO & "\Lanciatore\A" For Input As #1
                                
                                Print #1, Sheets("NOME").Range("J11")
                                Close #1 'Chiusura File
                                Exit Sub
                                ' 2
                                2:
                                If Dir(INDIRIZZO & "\Lanciatore\2.LBDP") <> "" Then GoTo NOME_PARTITA_2 Else GoTo 3
                                NOME_PARTITA_2:
                                If Dir(INDIRIZZO & "\Lanciatore\B") = "" Then: Exit Sub
                                Open INDIRIZZO & "\Lanciatore\B" For Input As #1
                                Print #1, Sheets("NOME").Range("J11")
                                Close #1 'Chiusura File
                                Exit Sub
                                ' 3
                                3:
                                If Dir(INDIRIZZO & "\Lanciatore\3.LBDP") <> "" Then GoTo NOME_PARTITA_3 Else GoTo ESCI
                                NOME_PARTITA_3:
                                If Dir(INDIRIZZO & "\Lanciatore\C") = "" Then: Exit Sub
                                Open INDIRIZZO & "\Lanciatore\C" For Input As #1
                                Print #1, Sheets("NOME").Range("J11")
                                
                                Close #1 'Chiusura File
                                ESCI:
                                Exit Sub
                                End Sub
                                
                                #4138 Score: 0 | Risposta

                                albatros54
                                Moderatore
                                  89 pts
                                  Possibile che nessuno risponde
                                  Non  rispondiamo a chiamata, mettiamo a disposizione degli utenti del forum il nostro tempo libero per cercare di risolvere i vari quesiti,dopo di che , ci sono modi e modi di porsi.
                                   
                                  Qual è il punto di avere gusti diversi, se non mostrare che i cervelli lavorano diversamente, che pensiamo diversamente? ( Alan Turing)
                                  Sempre il mare, uomo libero, amerai!
                                  ( Charles Baudelaire )
                                  #4141 Score: 0 | Risposta

                                  Fabio
                                    Di le stesse cose ha   Oscar   che ha risposto (Cos’è sto romanzo) vedendo che trovavo difficoltà nel porre la domanda!!... dopo di che , ci sono modi e modi di porsi.
                                    #4142 Score: 0 | Risposta

                                    Fabio
                                      è davvero impossibile riprovo.
                                       
                                      Di le stesse cose ha Oscar che ha risposto (cos'è sto romanzo) vedendo la difficoltà nel postare la domanda! dopo di che, ci sono modi e modi di porsi.
                                      #4144 Score: 0 | Risposta

                                      Fabio
                                        Sub ImportaFileTesto()
                                            FileTesto = ActiveWorkbook.Path & "\FileTesto.txt"
                                            
                                            Open FileTesto For Input As #1
                                                nRiga = 0
                                        leggiAncora:
                                                nRiga = nRiga + 1
                                                If Not EOF(1) Then
                                                    Line Input #1, Riga$
                                                    Cells(Numriga, 1) = Riga$
                                                    GoTo leggiAncora
                                                End If
                                            Close #1
                                        End Sub
                                        Ho risolto adattando questo codice.
                                        #4152 Score: 0 | Risposta

                                        Oscar
                                        Partecipante
                                          45 pts
                                          Ciao Fabio
                                          Scusa ma non si tratta di saper rispondere o no ,(io credo che tu dovresti dare una ripassatina al regolamento......)
                                        Login Registrati
                                        Stai vedendo 19 articoli - dal 1 a 19 (di 19 totali)
                                        Rispondi a: Scrivere in cella il contenuto di un file txt
                                        Gli allegati sono permessi solo ad utenti REGISTRATI
                                        Le tue informazioni: