Private Sub Worksheet_Change(ByVal Target As Range)
' Do Something
End Sub

I have the above code in Sheet1 of my Workbook. When I Insert a new
Worksheet, I want the code to be copied to the new Worksheet as well,
OR have the original code work in all Worksheets.

Can someone explain how?

Re: Insert Code with Worksheet by Don

Don
Thu May 08 09:37:38 CDT 2008

Look in the ThisWorkbook module and use this
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
"iamnu" <iamnubw@gmail.com> wrote in message
news:93f6271b-da0b-4578-9364-33ff6c6b661d@u6g2000prc.googlegroups.com...
> Private Sub Worksheet_Change(ByVal Target As Range)
> ' Do Something
> End Sub
>
> I have the above code in Sheet1 of my Workbook. When I Insert a new
> Worksheet, I want the code to be copied to the new Worksheet as well,
> OR have the original code work in all Worksheets.
>
> Can someone explain how?


Re: Insert Code with Worksheet by iamnu

iamnu
Thu May 08 09:52:55 CDT 2008

On May 8, 8:37 am, "Don Guillett" <dguille...@austin.rr.com> wrote:
> Look in the ThisWorkbook module and use this
> Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
>
> End Sub
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> dguille...@austin.rr.com"iamnu" <iamn...@gmail.com> wrote in message
>
> news:93f6271b-da0b-4578-9364-33ff6c6b661d@u6g2000prc.googlegroups.com...
>
> > Private Sub Worksheet_Change(ByVal Target As Range)
> > ' Do Something
> > End Sub
>
> > I have the above code in Sheet1 of my Workbook. When I Insert a new
> > Worksheet, I want the code to be copied to the new Worksheet as well,
> > OR have the original code work in all Worksheets.
>
> > Can someone explain how?

Thank you, sir!

Re: Insert Code with Worksheet by Don

Don
Thu May 08 10:22:55 CDT 2008

Glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
"iamnu" <iamnubw@gmail.com> wrote in message
news:2e883e7d-4269-47a6-b260-33a06f6eba04@z24g2000prf.googlegroups.com...
> On May 8, 8:37 am, "Don Guillett" <dguille...@austin.rr.com> wrote:
>> Look in the ThisWorkbook module and use this
>> Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
>> Range)
>>
>> End Sub
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> dguille...@austin.rr.com"iamnu" <iamn...@gmail.com> wrote in message
>>
>> news:93f6271b-da0b-4578-9364-33ff6c6b661d@u6g2000prc.googlegroups.com...
>>
>> > Private Sub Worksheet_Change(ByVal Target As Range)
>> > ' Do Something
>> > End Sub
>>
>> > I have the above code in Sheet1 of my Workbook. When I Insert a new
>> > Worksheet, I want the code to be copied to the new Worksheet as well,
>> > OR have the original code work in all Worksheets.
>>
>> > Can someone explain how?
>
> Thank you, sir!