Hi all,
I'm trying to read an array of True/False values from a named range in Excel into VBA. I can only get this to work if I declare the variable "comparators" as a variant, but this doesn't work if I declare it as a boolean type. My question is..why?
Code
Option Private Module
Option Explicit
Sub Run_Model()
Dim Comparators() As Boolean, i As Long
Comparators = Range("GenSettings.ComparatorsCheckboxes.Value")
For i = 1 To 7
Debug.Print Comparators(i, 1)
If Comparators(i,1) Then
'Do stuff
End If
Next i
End Sub
Display More
Thanks!
Chris