0

I have a userform with an initialize event as follows:

Public CurrSpanNum, CurrSegNum As Integer
Private Sub UserForm_Initialize()

        CurrSegNum = Sheets("UserData").Range("C2").value
        Debug.Print "SegForm, SpanNum = " & CurrSpanNum
        CurrSpanNum = Sheets("UserData").Range("D2").value
        Debug.Print "SegForm, SegNum = " & CurrSegNum

End Sub

In the immediate window I see:

SegForm, SpanNum = 
SegForm, SegNum = 3

The value 3 is placed in both cells before the form is initialized. Why can't I seem to load SpanNum while SegNum is able to load?

1 Answer 1

4

Well, your CurrSpanNum variable is not initialized and so prints nothing, What would you expect?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.