Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write macros Aries6 Excel Discussion (Misc queries) 2 December 16th 05 03:40 PM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
Can you freely write excel macros in C# yet? Sayeed Excel Programming 0 March 28th 05 05:56 AM
write error - even when no macros run Jabba Excel Programming 0 October 26th 04 12:53 PM
Macros that write data to a new spreadsheet? StargateFanFromWork Excel Programming 3 June 24th 04 04:08 PM


All times are GMT +1. The time now is 02:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"