Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create new worksheet without macros 1

Status
Not open for further replies.

rarogersonkf

Programmer
Aug 23, 2005
23
0
0
CA
I am creating a new work sheet (sheet2) from a macro on sheet1. I later intend on emailing sheet2 (as an attachment through File->Send). The problem is that when the new worksheet (sheet2) is opened by the recipient he gets the macro that was used to create the sheet. I would like the new sheet to not include the macro if possible.

Thanks in advance for your insight.

Rob
 
Move the worksheet to a new book and then email that.
Warning: if you copy rather than move you will lose data if any cells contain more than 255 characters.

Thanks,

Gavin
 

Hi,

Your macro need to be moved from the Worksheet Object (that gets copied and eMailed along with the macro) to a MODULE (that does not get copied when you copy a sheet).

In the VB Editor right click in the Project Explorer and Insert a Module.

Cut the code in the Worksheet Object

Paste into the Module Object.

Skip,
[sub]
[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top