VBA compile error label not defined

B

bkey01

I have an Excel workbook with multiple listbox's and command button.
have set an errhandler for printing. The first time it worked find an
know I am getting an error that says:
Compile error
Label not found
for errhandler7

Ex. code

if listbox1.selected(7) then goto errhandler7
listbox1.selected(7)=false

errhandler7:
sheet1.printout
sheet2.printout
sheet3.range("a1:aa40").print

Can anyone help
 
R

Robin Hammond

Sounds like there is a compile problem. Try exporting the module in
question, then delete it from the project, then import the module back. I
seem to plug Rob Bovey's codecleaner a lot, which helps to clear up problems
like this. www.appspro.com.

Robin Hammond
www.enhanceddatasystems.com
 
B

BrianB

Looks like a corrupted module.

Copy code to notepad. Delete the module, then copy/paste from notepa
into a new module
 
Top