LeilaMansouri
New Member
- Joined
- Jul 20, 2017
- Messages
- 2
Hi,
I am trying to get a range of data from a column of my Excel sheet on VBA, and then process each cell of the column one by one.
By there is a run time error "Subscript out of range" while getting the ListObject.
Could you please let me know what this wrong with the code and who can I resolve it?
I am trying to get a range of data from a column of my Excel sheet on VBA, and then process each cell of the column one by one.
By there is a run time error "Subscript out of range" while getting the ListObject.
Could you please let me know what this wrong with the code and who can I resolve it?
Code:
Dim sourceWS As WorksheetDim databaseTable As ListObject
Dim pinNumberColumn As Range
Set sourceWS = Sheets("Hello")
Set databaseTable = sourceWS.ListObjects(1)
Set pinNumberColumn = databaseTable.ListColumns("Pin-Nr.").DataBodyRange