Embed Button in Cell

JFW322

New Member
Joined
Jul 9, 2019
Messages
1
I currently use a sheet to price a particular type of financial instrument. The pricer is about 4 columns wide and extends down maybe 50 rows. I simply copy and paste it over when I want to make price a new instrument. The sheet uses an add-in to pull in live market data. In certain situations I copy and paste values in the cells of a particular iteration that are pulling in live data in order to create a “snap shot”. I’d like to write some vba code to do this copy/paste values (easy enough). What I’m not sure how to do (or if it’s possible) is embed a button that executes the code in a cell so that when I copy and paste to start a new pricing iteration, the button copies over with it. It would also need to apply only to that particular set of columns.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
If you can do it by hand you can do it with VBA.

A button is a shape. SO you can add a shape to the sheet, after checking and deleting any old shapes, in the cell you want it and link it to a macro you have. Or you just recycle the button you already have
You position the shape with shape.top = cells("B10).top and shape.left= Cells("B10").left
 
Upvote 0

Forum statistics

Threads
1,213,504
Messages
6,114,016
Members
448,543
Latest member
MartinLarkin

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