ho un problema su una formula VBA. Sono riuscito a copiare diverse celle in ordine sparso da svariati file presenti in una cartella e incollarli in un nuovo file in riga ed uno sotto l'altro.. il mio grosso problema è che alcune celle non me le copia anche se il percorso è giusto.. secondo voi è possibile che ciò avvega perche ci sono delle formattazioni delle celle tipo formule e/o delle valute?
per esempio ho un dei campi dove ho scritto NOME DELLA BANCA, RATA, DURATA PRESTITO E MONTANTE (Formula rata x durata) non mi copia nulla di ciò che ho appena descritto e non capisco il perchè.. ovviamente quelli appena descritti sono dati fondamentali.
Visto che questa è la mia prima formula in VBA avrei bisogno di un consiglio su come risolvere il mio problema. ecco la formula che ho creato-scopiazzato sarei disposto ad inviare una copia del file per farvi capire esattamente di che cosa ho bisogno
grazie ;-)
- Codice: Seleziona tutto
Sub CARICA_DATI_DIRETTO()
ChDir ("C:\Users\MY CREDIT\Desktop\PROVA MACRO")
MyF = Dir("*.xls")
If MyF = "" Then Exit Sub
While MyF <> ""
Call Fimp(MyF)
MyF = Dir
Wend
End Sub
Sub Fimp(NFile)
Workbooks.Open Filename:=NFile
Sheets("TELEFONATA").Activate
RNum = ThisWorkbook.Sheets("Foglio1").Cells(Rows.Count, "A").End(xlUp).Row
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "A") = Range("A1").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "B") = Range("B2").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "C") = Range("B3").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "D") = Range("B4").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "E") = Range("B5").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "F") = Range("B7").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "G") = Range("B8").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "H") = Range("B9").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "I") = Range("B10").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "J") = Range("C10").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "K") = Range("B11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "L") = Range("C11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "M") = Range("B12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "N") = Range("C12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "O") = Range("B13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "P") = Range("B15").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "Q") = Range("B17").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "R") = Range("B19").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "S") = Range("B20").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "T") = Range("C20").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "U") = Range("B21").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "V") = Range("B23").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "W") = Range("B24").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "X") = Range("B25").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "Y") = Range("C25").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "Z") = Range("B27").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AA") = Range("B28").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AB") = Range("B29").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AC") = Range("C30").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AD") = Range("C31").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AE") = Range("C32").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AF") = Range("C33").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AG") = Range("C34").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AH") = Range("B36").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AI") = Range("B37").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AJ") = Range("B38").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AK") = Range("H1").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AL") = Range("H2").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AM") = Range("H3").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AN") = Range("H5").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AO") = Range("H8").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AP") = Range("E12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AQ") = Range("F12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AR") = Range("H12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AS") = Range("I12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AT") = Range("J12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AU") = Range("K12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AV") = Range("N12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AW") = Range("O12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AX") = Range("P12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AY") = Range("Q12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AZ") = Range("R12").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AP") = Range("E13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AQ") = Range("F13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AR") = Range("H13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AS") = Range("I13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AT") = Range("J13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AU") = Range("K13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AV") = Range("N13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AW") = Range("O13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AX") = Range("P13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AY") = Range("Q13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AZ") = Range("R13").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AP") = Range("E14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AQ") = Range("F14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AR") = Range("H14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AS") = Range("I14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AT") = Range("J14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AU") = Range("K14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AV") = Range("N14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AW") = Range("O14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AX") = Range("P14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AY") = Range("Q14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "AZ") = Range("R14").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BA") = Range("H23").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BB") = Range("H24").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BC") = Range("H25").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BD") = Range("H26").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BE") = Range("H27").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BF") = Range("H28").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BG") = Range("H29").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BH") = Range("H30").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BI") = Range("H31").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BJ") = Range("H32").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BK") = Range("H33").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BL") = Range("H34").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BM") = Range("H35").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BN") = Range("H36").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BO") = Range("H37").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BP") = Range("H38").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BQ") = Range("H39").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BR") = Range("B6").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BS") = Range("B16").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BT") = Range("B18").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BU") = Range("B26").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BV") = Range("B30").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BW") = Range("B31").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BX") = Range("B32").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BY") = Range("B33").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "BZ") = Range("B35").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CA") = Range("H4").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CB") = Range("H7").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CC") = Range("E11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CD") = Range("F11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CE") = Range("H11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CF") = Range("I11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CG") = Range("J11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CH") = Range("K11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CI") = Range("M11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CJ") = Range("N11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CK") = Range("O11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CL") = Range("P11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CM") = Range("Q11").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CN") = Range("H16").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CO") = Range("H17").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CP") = Range("H18").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CQ") = Range("H19").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CR") = Range("H20").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CS") = Range("H21").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CT") = Range("H22").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CU") = Range("H23").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CV") = Range("H24").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CW") = Range("H25").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CX") = Range("H26").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CY") = Range("H27").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "CZ") = Range("H28").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DA") = Range("H29").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DB") = Range("H30").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DC") = Range("H31").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DD") = Range("H32").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DE") = Range("H33").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DF") = Range("H34").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DG") = Range("H35").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DH") = Range("H36").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DI") = Range("H37").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DJ") = Range("H38").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DK") = Range("H39").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DL") = Range("H40").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DM") = Range("H41").Value '<<<
ThisWorkbook.Sheets("Foglio1").Cells(RNum + 1, "DN") = Range("H42").Value '<<<
Workbooks(NFile).Close savechanges:=False
End Sub