Command button moves even with don't move or resize checked.

K

kelee

I have a command button that starts a macro that deletes, resizes, clears,
etc various sheets in my workbook. I have formatted it so it isn't supposed
to resize or move but it still does and gets smaller and moves every time I
click on it.

Any ideas?
 
S

Sheeloo

Apparently something in your code is forcing it to move...

This might happen if you delete rows, resize,...
 
D

Dave Peterson

You're not the first to have this problem.

Some posters have reported that if they delete the commandbutton and add a new
one, the problem goes away (temporarily????).

I usually use buttons from the Forms toolbar. They seem to behave much better.
 
K

kelee

I was using the same macro format for several worksheets and inserted a
command button in each of them. Still did the same thing. Can you insert
the forms button into the worksheet? I've never tried to do that as usually
the macros are for my use only. This one is for other people and I need to
make it easier.
 
D

Dave Peterson

In xl2003, you can show the forms toolbar (view|toolbars) and insert a button
from that forms toolbar.

They look almost the same.

The main difference is that the commandbutton (from the control toolbox toolbar)
has a "CommandButton1_Click()" event where the code is located.

The buttons from the Forms toolbar are assigned macros. These macros will live
in a General module--not behind the worksheet.

So you'll have to move (and probably(?) have to modify the code slightly) to a
general module. And then rightclick on the button and choose assign macro.

Depending on what the code is, it may be minor changes -- or none.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top