ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro for individuals worksheets (https://www.excelbanter.com/excel-discussion-misc-queries/218538-macro-individuals-worksheets.html)

chrisnsmith

Macro for individuals worksheets
 
I used the macro recorder to create a macro for one of the worksheets in my
workbook, and added a button to my toolbar. My problem is I need different
macros for each worksheet.

Can I create a macro that will be specific to each worksheet rather than the
entire workbook?

Khoshravan

Macro for individuals worksheets
 
All Macros you create have unique names and they are accessible through all
worksheets.
If you are going to use same Marco in different sheets, you don't need to
record for each sheet. One is enough for all work sheets and under special
circumstances even you can access them from other workbooks (excel files) as
well.

"chrisnsmith" wrote:

I used the macro recorder to create a macro for one of the worksheets in my
workbook, and added a button to my toolbar. My problem is I need different
macros for each worksheet.

Can I create a macro that will be specific to each worksheet rather than the
entire workbook?


Don Guillett

Macro for individuals worksheets
 

Lot's of ways. As ALWAYS, post YOUR code for comments and suggestions

for each ws in worksheets
ws.do your thing
next

activeworksheet.range("a1")=1


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"chrisnsmith" wrote in message
...
I used the macro recorder to create a macro for one of the worksheets in my
workbook, and added a button to my toolbar. My problem is I need
different
macros for each worksheet.

Can I create a macro that will be specific to each worksheet rather than
the
entire workbook?




All times are GMT +1. The time now is 07:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com