I have an excel sheet with some data that is formatted as table with titles for columns, like the attached image
I want to get a specific cell value (lets say the highlighted cell with value 50) using the column title.
I used many combinations of codes but some of them did not work at all and some others gave me the error "Application-defined or object-defined error"
Dim XLApp as Object Dim XLBook as Object Dim XLSheet as Object Dim Value as Integer Set SLApp = CreateObject("Excel.Application") set XLBook = XLApp.Workbooks.Opem(FilePath) Set XLSheet = XLBook.Worksheets(1)
I used the following lines of code to get the value
Value = XLSheet.Range(4)("Item Price") Value = XLSheet.Range(4,"Item Price") Value = XLSheet.Cells(4)("Item Price") Value = XLSheet.Cells(4,"Item Price")
your early response is highly appreciated.
Thanks in advance.