I am reading some cells of excel using VBA.
Function getData(currentWorksheet as Worksheet, dataStartRow as Integer, _ dataEndRow as Integer, DataStartCol as
What is currentWorksheet? It works if you use the built-in ActiveSheet.
currentWorksheet
ActiveSheet
dataStartRow=1 dataStartCol=1 dataEndRow=4 dataEndCol=4 Set currentWorksheet=ActiveSheet dataTable = currentWorksheet.Range(currentWorksheet.Cells(dataStartRow, dataStartCol), currentWorksheet.Cells(dataEndRow, dataEndCol))