I am trying to create a global array by converting a table into an array in the first code, and then calling it in the second code. However, i get a run-time error '13' type mismatch when calling my second code.
Public prio_row_num
Public prioritytbl As Variant
Sub Tabletoarray()
Dim prioritytbl As Variant
Worksheets("Prod_met").Activate
prioritytbl = ActiveSheet.ListObjects("prioritylist").DataBodyRange.Value
End Sub
Sub test()
MsgBox (prioritytbl(2, 2))
End Sub
I want to be able to call the prioritytbl in subsequent parts of my code.