Forum Discussion
shankar_r
9 years agoCommunity Hero
Hi,
Below code will copy only the visible cells from Sheet1 Range("A1:F1") to Sheet2 Range("A2:F2").
Sub ReadDataFromExcel
Dim Excel
Set Excel = Sys.OleObject("Excel.Application")
Excel.Workbooks.Open("D:\Users\Documents\Testss.xlsx")
Excel.ActiveWorkbook.Sheets.Item("Sheet1").Range("A1:F1").SpecialCells(12).Copy(Excel.ActiveWorkbook.Sheets.Item("Sheet2").Range("A2:F2"))
Excel.ActiveWorkbook.Save
Excel.Quit
End Sub
You can customize this code as per your requirement.