VBScript скопировать последнюю использованную строку из файла excel
i have a excel file, i want to copy the last used row from sheet1 to sheet2 use vbscript. can anyone help me?
Что я уже пробовал:
Here is the code: Set x6 = CreateObject("Excel.application") Set XlBook = x6.Workbooks.Open(".xlsx") x6.Visible = True Set Xlsheet = XlBook.Worksheets("Sheet2") Set Xlsheet1 = XlBook.Worksheets("sheet1") With Xlsheet 'Dim lastrow Xlsheet1.Range("A:D").End(xlUp).Row Xlsheet1.Range("A:D").Copy .Range(.Cells(1, j + 2), .Cells(6, j + 2)) End With