I have declared "Dim ArtsArr" at the top of a module.
The attached code works fine and populates ArtsArr successfully. I have Watched it and note that the variable ArtsArr goes out of context immediately on End Sub. This is a public variable so that should not happen. Why?
When I run the following code immediately after, I get a Type Mismatch on the For Counter = line.
That is because ArtsArr is now out of context, and therefore UBound(ArtsArr,1) is a null value.
' calculate the RCI for each FoR in each article, and add into Cols 12, 15, 18 in ArtsArr
For Counter = 1 To UBound(ArtsArr, 1)
Excel insanity yet again ...
Anyone see the problem here?
Dim VirtualBook As Workbook, FilePointer As String
FilePointer = ThisWorkbook.Path & "\list-of-jnls.xls"
If Dir(FilePointer) <> "" Then
Set VirtualBook = Workbooks.Open(FilePointer)
NumArts = Range("A1").CurrentRegion.Rows.Count - 1
NumCols = Range("A1").CurrentRegion.Columns.Count
ArtsArr = Range("A2").Resize(Range("A1").CurrentRegion.Rows.Count - 1, _
MsgBox "File not found”