ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet Specific Code (https://www.excelbanter.com/excel-programming/324894-worksheet-specific-code.html)

Paul

Worksheet Specific Code
 
I have a template worksheet that I update and then copy 50 times (one for
each state)

There is a macro that is linked to the worksheet that executes upon double
click. How can I make this sheet specific code copy when the sheet is copied?
Or is there a way to link to another sub that will do the same thing?

Sample Code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
'Tester Sub
MsgBox "Testing Here", vbInformation, "OH NO!"
End Sub

--
Paul

Dave Peterson[_5_]

Worksheet Specific Code
 
This kind of code (in the worksheet module) should copy when you copy the
worksheet.

Are you copying the cells on the worksheet or are you really copying the
worksheet???


Paul wrote:

I have a template worksheet that I update and then copy 50 times (one for
each state)

There is a macro that is linked to the worksheet that executes upon double
click. How can I make this sheet specific code copy when the sheet is copied?
Or is there a way to link to another sub that will do the same thing?

Sample Code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
'Tester Sub
MsgBox "Testing Here", vbInformation, "OH NO!"
End Sub

--
Paul


--

Dave Peterson

Paul

Worksheet Specific Code
 
That did the trick, I was just copying the cells. Thanks for your help!


"Dave Peterson" wrote:

This kind of code (in the worksheet module) should copy when you copy the
worksheet.

Are you copying the cells on the worksheet or are you really copying the
worksheet???


Paul wrote:

I have a template worksheet that I update and then copy 50 times (one for
each state)

There is a macro that is linked to the worksheet that executes upon double
click. How can I make this sheet specific code copy when the sheet is copied?
Or is there a way to link to another sub that will do the same thing?

Sample Code:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
'Tester Sub
MsgBox "Testing Here", vbInformation, "OH NO!"
End Sub

--
Paul


--

Dave Peterson



All times are GMT +1. The time now is 10:05 PM.

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