Macro for individuals worksheets

C

chrisnsmith

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?
 
K

Khoshravan

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.
 
D

Don Guillett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top