Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To all,
I have written a macro that does various things in a worksheet called DATA. At the moment I am running in by using a button in this worksheet, so that when the user clicks it, it runs. However I wish to place a button on the main worksheet called WELCOME and to run the macro in the DATA spreadsheet. Is it possible to do this without rewriting the macro that I have in the DATA worksheet? Thanks in advance, Regards Joseph Crabtree |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As the macro executes, it needs to know on what sheet to perform its
operations: Sub demo() Dim ws As Worksheet Set ws = Sheets("DATA") ws.Range("A1").Value = 1 End Sub tells the macro that DATA is the sheet to change, not the ActiveSheet. -- Gary's Student "joecrabtree" wrote: To all, I have written a macro that does various things in a worksheet called DATA. At the moment I am running in by using a button in this worksheet, so that when the user clicks it, it runs. However I wish to place a button on the main worksheet called WELCOME and to run the macro in the DATA spreadsheet. Is it possible to do this without rewriting the macro that I have in the DATA worksheet? Thanks in advance, Regards Joseph Crabtree |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"joecrabtree" wrote in
ps.com: To all, I have written a macro that does various things in a worksheet called DATA. At the moment I am running in by using a button in this worksheet, so that when the user clicks it, it runs. However I wish to place a button on the main worksheet called WELCOME and to run the macro in the DATA spreadsheet. Is it possible to do this without rewriting the macro that I have in the DATA worksheet? If your macro is NOT 'private' you should be able to access it from any sheet in the workbook. Have you tried attaching it to a button on the WELCOME worksheet? -- bz please pardon my infinite ignorance, the set-of-things-I-do-not-know is an infinite set. remove ch100-5 to avoid spam trap |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Place a button on a worksheet and assign a macro to it? | New Users to Excel | |||
How to insert a macro button in a worksheet | Excel Discussion (Misc queries) | |||
Tooltip for macro button in a worksheet | Excel Worksheet Functions | |||
Adding Macro to Button on WOrksheet | Excel Discussion (Misc queries) | |||
How to end macro on inital active worksheet containing macro button that was clicked | Excel Programming |