+ Reply to Thread
Results 1 to 6 of 6

Italian/Italiano: Copiare contenuti da un file se si verifica condizione sul file destinaz

  1. #1
    Registered User
    Join Date
    07-10-2017
    Location
    italy
    MS-Off Ver
    2007
    Posts
    4

    Italian/Italiano: Copiare contenuti da un file se si verifica condizione sul file destinaz

    Buongiorno. Premetto che sono all'inizio con VBA. E girando un po per il web ho trovato una macro VBA che fa al caso mio...l'ho modificata secondo i miei parametri e più o meno sono riuscito quasi ad ottenere cio' che voglio.
    Il mio problema è questo:
    Ho 2 fogli excel. Vorrei copiare il contenuto di tutte le celle J (è un valore numerico) del file DAK_movimenti iva acquisti.xlsx dal foglio chiamato FR e riportarli nel file, nella cella M, ELABORATOfattur_notecredito.xlsx nel foglio chiamato Foglio1 a condizione che in questo ultimo file(quello di destinazione in pratica), per la riga corrispondente, nella colonna K ci sia il valore RD01...e ripetere la stessa operazioni per le righe successive logicamente non andando a toccare quelle che non soddisfano la condizione.
    Purtroppo ottengo un risultato parziale in quanto mi riporta solo la prima riga che soddisfa la condizione le altre non le legge...non capisco dove sbaglio
    Allego il codice VBA
    Grazie

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    07-10-2017
    Location
    italy
    MS-Off Ver
    2007
    Posts
    4

    Re: Italian/Italiano: Copiare contenuti da un file se si verifica condizione sul file dest

    For anyone that wants help me i translate in english

    Good morning. I'm beginner with VBA. And turning a bit on the web I found a VBA macro that is just my case ... I modified it according to my parameters and almost or not I managed to get what I want.
    My problem is this:
    I have 2 sheets of excel. I would like to copy the contents of all the cells J (is a numeric value) of the DAK_movimenti iva purchases.xlsx file from the sheet named FR and return them to the file in cell M, ELABORATOfattur_notecredito.xlsx in the sheet called Sheet1 provided that in this last file The target line in practice), in the column K k is the value RD01 ... and repeat the same operation for the next lines logically not going to touch those that do not meet the condition.
    Unfortunately I get a partial result as it only contains the first line that meets the condition the others do not read ... I do not understand where I'm wrong
    I attach the VBA code
    Thank you
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Italian/Italiano: Copiare contenuti da un file se si verifica condizione sul file dest

    Code doesn't make much sense to me... it seems broken in various different ways.
    But an example file mgiht help

    But maybe this is closer to what you want.

    Please Login or Register  to view this content.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  4. #4
    Registered User
    Join Date
    07-10-2017
    Location
    italy
    MS-Off Ver
    2007
    Posts
    4

    Re: Italian/Italiano: Copiare contenuti da un file se si verifica condizione sul file dest

    Thank for your reply Scottiex
    i send you 2 samples files
    Watch out but when i copied the code the correct value on the "if" is not
    If UCase(Workbooks(nfile).Worksheets(nSheet).Range("K" & RRA)) = "KD01" Then
    but it's
    If UCase(Workbooks(nfile).Worksheets(nSheet).Range("K" & RRA)) = "RD01" Then
    Attached Files Attached Files
    Last edited by pom73; 07-12-2017 at 04:00 AM.

  5. #5
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Italian/Italiano: Copiare contenuti da un file se si verifica condizione sul file dest

    Maybe
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-10-2017
    Location
    italy
    MS-Off Ver
    2007
    Posts
    4

    Re: Italian/Italiano: Copiare contenuti da un file se si verifica condizione sul file dest

    thank you very much Scottiex....it works very good!!!!
    You Rock!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro - Open File Explorer, Select File, Import certain information from file
    By Drayde in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2015, 08:58 AM
  2. Save as macro that specifies file type, file location and takes file name from three cells
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2013, 10:09 PM
  3. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  4. Replies: 0
    Last Post: 01-27-2013, 12:13 PM
  5. Verifica utilizzo funzione SE
    By drsteffa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-07-2012, 06:12 AM
  6. Italiano - Dove pubblicare un programma in Excel
    By Juvanum in forum Non English Excel
    Replies: 2
    Last Post: 04-20-2012, 04:44 AM
  7. How to: Open file, format data, save file, close file and repeat.
    By thexeber in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2010, 12:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1