MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Sorting Macro using a command button


Posted by Duane Kennerson on November 24, 2000 3:18 PM

I have recorded a macro that sort a worksheet for me. The macor
works fine when I use the shortcut key I made for it. I
created a command button that calls the macro but when I run the
macro from the command button, it tells me the goto method failed.
Can anybody explain this???


Posted by Ivan Moala on November 24, 2000 3:55 PM

In your code you may have something like
Application.Goto ??
With your commandbutton, select the propertie
TakeFocuOnClick and set thisto False.
This should take care of your problem.

Ivan

Posted by Duane Kennerson on November 24, 2000 4:35 PM

I have recorded a macro that sort a worksheet for me. The macor