automated macro's? and macro limitation to a worksheet

F

FAM THEUWS

1) Is there a way to automatically copy the content of a worksheet to a file
which has the name of that worksheet.
2) Is it possible to assign and limit a macro to a worksheet. I'm only
capable to attach a macro to a complete .xls file.
 
D

Dick Kusleika

FAM

1) Is there a way to automatically copy the content of a worksheet to a file
which has the name of that worksheet.

Dim wb as Workbook
Dim sh as Worksheet

Set sh = ActiveSheet
Set wb = sh.Copy
wb.SaveAs sh.Name

Using Copy on a worksheet creates a new workbook with only that sheet. You
can then save the new workbook using the sheet's name.
2) Is it possible to assign and limit a macro to a worksheet. I'm only
capable to attach a macro to a complete .xls file.

Why? You can write a macro such that it only acts on a specific sheet or
can only be called by a specific sheet.
 

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