Jun 28 2018
11:00 AM
- last edited on
Jul 25 2018
10:06 AM
by
TechCommunityAP
Jun 28 2018
11:00 AM
- last edited on
Jul 25 2018
10:06 AM
by
TechCommunityAP
I'm using three List Boxes on one sheet (the Font Book tab), where clicking one deselects the other two. The worksheet functions as expected, but on opening the workbook, I receive the "Compile error" popup. Specifically, it is in the script for the first List Box (ListBox1), and VBA highlights the second List Box (ListBox2) where I'm clearing the List Box values. Any assistance would be appreciated.
Jun 28 2018 04:42 PM - edited Jun 29 2018 01:56 PM
SolutionYou had the code in a code module and a worksheet code module. If the code is in the worksheet module you can use syntax like:
Me.ListBox2.Value = ""
If you use a code module you have to specify the worksheet:
Sheets("Font Book").ListBox2.Value = ""
It looks like your code was duplicative. I removed the code module stuff and now it works fine (See attached)
Jun 29 2018 02:06 PM
You're quite welcome. Glad you have it working. Please feel free to post back to the community in the future if you have any other inquiries.
Apr 26 2019 03:26 PM
Am I understanding correctly that this error means that the sheet has not been called in prior code? I am attempting to plot a chart and am calling from a sheet called Basic Duck and am having an error pop up that says the method is not found. I previously had a range error but that has been corrected. I have not previously named the sheet in the code though if that needs to happen.
Jun 15 2019 05:44 AM
Jun 28 2018 04:42 PM - edited Jun 29 2018 01:56 PM
SolutionYou had the code in a code module and a worksheet code module. If the code is in the worksheet module you can use syntax like:
Me.ListBox2.Value = ""
If you use a code module you have to specify the worksheet:
Sheets("Font Book").ListBox2.Value = ""
It looks like your code was duplicative. I removed the code module stuff and now it works fine (See attached)