Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying buttons & Excel

Status
Not open for further replies.

RicksAtWork

Programmer
Nov 1, 2005
120
GB
I am dynamically worksheets i.e. the worksheet is created and data is copied to it.

However I now want to add a button onto the sheet which will call a specific macro.

Is this posible via VBA?

 


Hi,

Why not have a sheet "template" that already has the macro-assigned button on it?


Skip,

[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue]
 
This was my oridinal plan however I couldn't work out how to duplicate a worksheet without copying the cells.

How do you do the duplication?
 
Have a look at the Workbooks.Add(Template) method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Actually I've sorted this - however

I have a button that calls a macro.

Is it possible within the macro to determine which worksheet the button was on?
 


Yes,

The Parent property of the Shape is the Sheet.


Skip,

[glasses] [red]Be Advised![/red]
A wee deranged psychic may be runnin' around out there!
SMALL MEDUIM @ LARGE[tongue]
 
You may also have a look at the Application.Caller method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top