problem command button

bam12

Well-known Member
Joined
Dec 6, 2004
Messages
984
i made a command button from the control toolbox
put code in it
and not i cant edit it
it like it is protected

any idea how to fix this
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Can't edit what?

The code or the button?

If it's the button then the problem is probably that you aren't in design mode.

To enter design mode click the set square in the top left on the Control Toolbox toolbar.
 
Upvote 0
button

i can edit buton
i am in edit mode
when i place cursor over the button i get circle with line thru it

also in edit mode everything is ghosted
 
Upvote 0
Code:
Private Sub CommandButton1_Click()

    Sheets(Array("Summary", "Completed")).Select
    Sheets("Summary").Activate
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

End Sub

Here is the code i have. it seems when I run the macro by clicking on the command button it act if it protected the worksheet, causing the above mentioned problem.

I can fix it by clicking on another worksheet and coming back to the one with the command button in it and it is ok.

Could it because I am missing something in code?

Thnaks for any help
 
Upvote 0
Why not just

Code:
Private Sub CommandButton1_Click()
    Sheets("Summary").PrintOut Copies:=1, Collate:=True
End Sub
 
Upvote 0
more sheets

i have 7 worksheets in the workbook but only print 2 of them,

summary and completed
 
Upvote 0
Code:
Private Sub CommandButton1_Click()
    Sheets(Array("Summary", "Completed")).PrintOut
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,874
Members
449,056
Latest member
ruhulaminappu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top