I am sure someone else will have a better way of doing this, but whenever I run into a problem like this I have a little trick I use, that will probably help you...
Go to Tools, Macros, and then choose Record a New Macro. Once the Macro has started recording, make a note of what it calls the macro, then do the steps you would like to have the VBA module do. In this case, insert a new sheet, rename it and add some data. Then stop the recording.
Now goto the VBA editor, and view the last Module under the modules section. The new macro will be under here, and will show you the steps that you need to follow to duplicate this. Rewrite it, change what you need to, and then assign your button to use the new Macro.
Hope that helps,
Mike
Mike
EchoVue.com
|