Checkbox problems

  • Thread starter Thread starter Mia
  • Start date Start date
M

Mia

Hi,

I don't get my checkbox to work. Do anyone know whats wrong with my code?

Sub Utskrift()

Application.ScreenUpdating = False

Utskriftsfunktion.Show

If canc = 4 Then Exit Sub

If canc = 5 Then

If CheckBox3 = True Then Call fakturapdf

If CheckBox4 = True Then Call specpdf

If CheckBox2 = True Then Call specprint

If CheckBox1 = True Then Call fakturaprint

Sheets("Indata").Select

Application.ScreenUpdating = True

End if

End Sub

I'll be wery grateful if someone can help me!
 
I assume your Checkboxes are ActiveX controls on the active sheet. Unless
your code is in the worksheet module, your use of Checkbox# needs be
qualified with a reference to the relevant sheet, eg

If ActiveSheet.CheckBox3 = True Then

or

If ActiveSheet.OLEObjects("CheckBox1").Object = True Then

In passing, the way your code is constructed your code might complete
without resetting Screenupdating.

Regards,
Peter T
 
You post is kind of vague. Is Utskriftsfunktion a Userform? And the
checkboxes and canc are on the userform? What is canc? Is it a combobox?
Please describe what you're this code is suppose to do vs. just saying it
doesn't work.
 
Back
Top