1

In object -Sheet2- I've this:

Private Sub Listbox1_Change()
    keuze = Sheet2.Listbox1.Text
End Sub

I want to use the variable keuze in a module, but what I try, it's empty. How can I solve this?

1 Answer 1

2

Declare keuze in module as

Public keuze As String

Then after assigning keuze = Sheet2.Listbox1.Text you can access value of keuze in module also.

By using the Public keyword, variable will be available across all modules and the value of Public variable will preserve until Workbook is closed or reset the Project.

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.