I have a large workbook with several sheets, and a hundred or so single cells defined as named ranges so that I can easily reference them from VBA. In the beginning this worked fine, but for some reason it stopped working. Suddenly I'm not able to reference the named ranges anymore, the result is just empty.
If I open a new blank workbook and use the following simple example it works as supposed, the value of the single cell with the range name "testrange" is displayed in a message box. But if I do the same thing in my existing workbook the message box is empty.
Sub Test()
Dim var As String
var = Range("testrange")
MsgBox (var)
End Sub
To me it seems as if I've somehow managed to break all named ranges in my existing workbook. I will be very grateful for all ideas about what might have caused this.
If I open a new blank workbook and use the following simple example it works as supposed, the value of the single cell with the range name "testrange" is displayed in a message box. But if I do the same thing in my existing workbook the message box is empty.
Sub Test()
Dim var As String
var = Range("testrange")
MsgBox (var)
End Sub
To me it seems as if I've somehow managed to break all named ranges in my existing workbook. I will be very grateful for all ideas about what might have caused this.