![]() |
Macro doesnt work from another sheet
I have attached my macro to a button and placed it in sheet 2 (which is an
empty sheet) but the macro doesnt work from that sheet. It does however work if i put the button in the sheet where all the data is. I also wanted to email a macro as well, how do i do this? please advise. thanks in advance. |
Macro doesnt work from another sheet
Zak,
You macro may be looking at the active sheet when in fact the data you are trying to work on may be in another. can you expand on the generic term of 'Doesn't work' Mike "zak" wrote: I have attached my macro to a button and placed it in sheet 2 (which is an empty sheet) but the macro doesnt work from that sheet. It does however work if i put the button in the sheet where all the data is. I also wanted to email a macro as well, how do i do this? please advise. thanks in advance. |
Macro doesnt work from another sheet
It reports error 1004, no cells were found. All the data the macro refers to
is in sheet 1 but i want to put the macro button in sheet 2 (because theres no room on sheet 1). And some of my macros do refer to "activesheet" how can i change this? but would this mean it would look in all sheets? i dont really want it to do that, i just want the macro button to be in an empty sheet because the one with all the info has no space! i know i can assign the macro to a button on the toolbar but i need to email the worksheet to a colleague with the macro on it, if its on the toolbar it wont display will it? thats why i want it on a button, unless there is another way to email the macro? thanks. "Mike H" wrote: Zak, You macro may be looking at the active sheet when in fact the data you are trying to work on may be in another. can you expand on the generic term of 'Doesn't work' Mike "zak" wrote: I have attached my macro to a button and placed it in sheet 2 (which is an empty sheet) but the macro doesnt work from that sheet. It does however work if i put the button in the sheet where all the data is. I also wanted to email a macro as well, how do i do this? please advise. thanks in advance. |
Macro doesnt work from another sheet
Add this line to the start of the macro:
Worksheets("Sheet2").activate "zak" wrote: It reports error 1004, no cells were found. All the data the macro refers to is in sheet 1 but i want to put the macro button in sheet 2 (because theres no room on sheet 1). And some of my macros do refer to "activesheet" how can i change this? but would this mean it would look in all sheets? i dont really want it to do that, i just want the macro button to be in an empty sheet because the one with all the info has no space! i know i can assign the macro to a button on the toolbar but i need to email the worksheet to a colleague with the macro on it, if its on the toolbar it wont display will it? thats why i want it on a button, unless there is another way to email the macro? thanks. "Mike H" wrote: Zak, You macro may be looking at the active sheet when in fact the data you are trying to work on may be in another. can you expand on the generic term of 'Doesn't work' Mike "zak" wrote: I have attached my macro to a button and placed it in sheet 2 (which is an empty sheet) but the macro doesnt work from that sheet. It does however work if i put the button in the sheet where all the data is. I also wanted to email a macro as well, how do i do this? please advise. thanks in advance. |
Macro doesnt work from another sheet
Another problem, that sheet will sometimes change too!
I need a way so that i can get the macro on my colleagues toolbar without having to email him the code to input himself (coz theres so much). please advise how i can get the macro to work from a colleagues toolbar.. how can i email or export across? thanks "Sam Wilson" wrote: Add this line to the start of the macro: Worksheets("Sheet2").activate "zak" wrote: It reports error 1004, no cells were found. All the data the macro refers to is in sheet 1 but i want to put the macro button in sheet 2 (because theres no room on sheet 1). And some of my macros do refer to "activesheet" how can i change this? but would this mean it would look in all sheets? i dont really want it to do that, i just want the macro button to be in an empty sheet because the one with all the info has no space! i know i can assign the macro to a button on the toolbar but i need to email the worksheet to a colleague with the macro on it, if its on the toolbar it wont display will it? thats why i want it on a button, unless there is another way to email the macro? thanks. "Mike H" wrote: Zak, You macro may be looking at the active sheet when in fact the data you are trying to work on may be in another. can you expand on the generic term of 'Doesn't work' Mike "zak" wrote: I have attached my macro to a button and placed it in sheet 2 (which is an empty sheet) but the macro doesnt work from that sheet. It does however work if i put the button in the sheet where all the data is. I also wanted to email a macro as well, how do i do this? please advise. thanks in advance. |
Macro doesnt work from another sheet
Dont worry, i sorted it!
thanks. "zak" wrote: Another problem, that sheet will sometimes change too! I need a way so that i can get the macro on my colleagues toolbar without having to email him the code to input himself (coz theres so much). please advise how i can get the macro to work from a colleagues toolbar.. how can i email or export across? thanks "Sam Wilson" wrote: Add this line to the start of the macro: Worksheets("Sheet2").activate "zak" wrote: It reports error 1004, no cells were found. All the data the macro refers to is in sheet 1 but i want to put the macro button in sheet 2 (because theres no room on sheet 1). And some of my macros do refer to "activesheet" how can i change this? but would this mean it would look in all sheets? i dont really want it to do that, i just want the macro button to be in an empty sheet because the one with all the info has no space! i know i can assign the macro to a button on the toolbar but i need to email the worksheet to a colleague with the macro on it, if its on the toolbar it wont display will it? thats why i want it on a button, unless there is another way to email the macro? thanks. "Mike H" wrote: Zak, You macro may be looking at the active sheet when in fact the data you are trying to work on may be in another. can you expand on the generic term of 'Doesn't work' Mike "zak" wrote: I have attached my macro to a button and placed it in sheet 2 (which is an empty sheet) but the macro doesnt work from that sheet. It does however work if i put the button in the sheet where all the data is. I also wanted to email a macro as well, how do i do this? please advise. thanks in advance. |
All times are GMT +1. The time now is 02:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com