ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to write other macros? (https://www.excelbanter.com/excel-programming/329765-macro-write-other-macros.html)

Darren Hill[_3_]

macro to write other macros?
 
I have the following simple macro:

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Range("Conditions"), Target) Is Nothing Then
Call FormatConditions(Target)
End If
End Sub

Is it possible to write a macro that adds this to the code module of all
worksheets?


Darren

Harald Staff

macro to write other macros?
 
Hi Darren

Yes.
http://www.cpearson.com/excel/vbe.htm
But there is a
Workbook_SheetChange
in ThisWorkbook, which is a common Worksheet_Change event for all worksheets
in the workbook. I'd use that.

HTH. Best wishes Harald

"Darren Hill" skrev i melding
news:op.sq1a21a5ed89cl@omega...
I have the following simple macro:

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Application.Intersect(Range("Conditions"), Target) Is Nothing Then
Call FormatConditions(Target)
End If
End Sub

Is it possible to write a macro that adds this to the code module of all
worksheets?


Darren





All times are GMT +1. The time now is 10:06 AM.

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