0
Dim wb As Workbook

    Set synthese = Sheets("Synthèse")
    Set wb = Workbooks.Open(Filename:="C:\Users\bm00096\Desktop\Stage PMTC AHMAD MUHAMAD 2018\RFE Management\Experimentation of outil and analysis\Evolution RFE_ANALYSIS v3.0.xlsm")
    wb.Sheets("Base").Visible = True
    Sheets("Base").Unprotect "roulage_ASVH"
    wb.Sheets("Base").Select

    i = 1

    While wb.Sheets("Base").Cells(i, 1).Value <> ""
        i = i + 1
    Wend

    synthese.Cells.Range("A2:AI100").Copy
    wb.Sheets("Base").Cells(i, 1).Select
    ActiveSheet.Paste
    Sheets("Base").Protect "roulage_ASVH"
    ActiveWindow.SelectedSheets.Visible = False
    wb.RefreshAll
    wb.Close True
    Application.CutCopyMode = False
    Set wb = Nothing
    Set synthese = Nothing

    Sheets("Synthèse").Unprotect "roulage_ASVH"
    Sheets("Synthèse").Range("A2:AI200").ClearContents
    Sheets("Synthèse").Protect "roulage_ASVH"

End Sub

Hi guys, basically i have 300 lines of data from the sheets 'Synthèse' and I want to transfer these datas into another workbook on the sheets 'Base'. So, I wrote a code to transfer these datas.The codes works really well its does transfer the datas. BUT, the problem is that, its only transferring 98 lines of data, not all 300 datas. I try to change the format of both workbook to the same format and its still doesn't works. Please help me with this problem.

0m3r
  • 12,286
  • 15
  • 35
  • 71
AHMAD
  • 17
  • 4
  • 1
    `A2:AI100` only contains 98 lines. You need to adjust that. • Also I recommend to read and apply [How to avoid using Select in Excel VBA](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba). – Pᴇʜ Nov 12 '18 at 09:35
  • @Pᴇʜ thank you for your help. It works – AHMAD Nov 12 '18 at 10:27

0 Answers0