Forum Discussion
kevin whiteside
Jun 28, 2018Copper Contributor
Compile error: Method or data member not found
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...
- Jun 28, 2018
You 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)
Matt Mickle
Jun 28, 2018Bronze Contributor
You 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)
Mconnolly31
Jun 15, 2019Copper Contributor
Hi is this maybe the same error I am seeing here please?
https://techcommunity.microsoft.com/t5/Excel/Compile-Error-Method-or-data-member-not-found/m-p/694161
https://techcommunity.microsoft.com/t5/Excel/Compile-Error-Method-or-data-member-not-found/m-p/694161