Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Through browsing this group, I have been able to apply code to all the
sheets in my workbook with the following test code. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address < "$E$2" Then Exit Sub Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets sh.Activate sh.Range("G2") = "test worked" Next End Sub '-------------------------------------------------------------------------------------------- Is there any way to call a sub to all worksheets. I've tried replaceing the SH.RANGE line with CALL TEST and it did not apply it to all sheets. I've tried using WITH statements as follows: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address < "$E$2" Then Exit Sub Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets sh.Activate with sh call test end with Next End Sub This did not work either. Any suggestions? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Call a function in some sheets | Excel Programming | |||
Can you call functions between sheets in the same book in excel? | Excel Worksheet Functions | |||
VBA code: call subprocedure | Excel Programming | |||
Code in one workbook to call code in another XL file | Excel Programming | |||
call VBA compiled code within vba | Excel Programming |