![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Insert Code with Worksheet
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
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
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
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! |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|