Control a Macro from Different Worksheet

steveal

New Member
Joined
May 4, 2017
Messages
5
I have downloaded a worksheet ('Data') which can access Yahoo for stock prices. The macro is controlled from a button on the worksheet "Download Prices". It works perfectly.
I use the data downloaded from Yahoo on another worksheet ('Mystocks') in the same workbook.

I want to run the macro using a new button on the 'Mystocks' sheet, so that I don't have to keep moving to the 'Data' sheet.
I have tried copying and pasting the button and tried creating a new button on 'Mystocks' without success. I've tried recording a macro to 'push' the button on the 'Data' sheet without success.

Can anyone suggest a solution?
 
Is there a macro assigned to the button on the sheet 'Data'?
 
Upvote 0
You should just be able to assign the same macro to any other buttons you create.
 
Upvote 0
You didn't mention assigning the same macro the new button or wiping all the data from the 'Mystocks' sheet.

Can you post the code that's in the macro assigned to the button on the 'Data' sheet?

Also, where is that code located?
 
Upvote 0
Norie,

I cross posted this on Excel Forum - made a bit of a mess of the thing, sorry. I don't want to complicate things more than I have.
 
Upvote 0
No problem.:)

Mind you I think I can see what the problem is with the code after seeing it on the other forum - all the range/cell references in the code are to the active sheet.

Can you upload a workbook to the other forum?
 
Upvote 0

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