Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for Work Sheet
Hi,
I have written 2 seperate codes for 2 different worksheets. and i would like to apply each of them only on the relevant worksheet, both codes a Private Sub Worksheet_Activate how can i apply each code only for 1 worksheet ? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for Work Sheet
Assuming that each routine is on the code module for its respective WS, it
will run when that WS is activated. It is not affected by code on other WS's. NickHK "Guye" wrote in message ups.com... Hi, I have written 2 seperate codes for 2 different worksheets. and i would like to apply each of them only on the relevant worksheet, both codes a Private Sub Worksheet_Activate how can i apply each code only for 1 worksheet ? thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for Work Sheet
As long as you Worksheet_Activate in the appropriate worksheet code modules,
and not Workbook_SheetACtivate in ThisWorkbook code module, they will only act upon the activation of that single sheet, and will not interfere with each other (unless your code triggers the other of course). -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Guye" wrote in message ups.com... Hi, I have written 2 seperate codes for 2 different worksheets. and i would like to apply each of them only on the relevant worksheet, both codes a Private Sub Worksheet_Activate how can i apply each code only for 1 worksheet ? thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for Work Sheet
Right-click the worksheet tab and select "View Code". This will open the
code module for that worksheet only. Above the code area are 2 drop-down arrows General & Declarations. Click on General arrow and select Worksheet. Now the right down arrow will give a list of Worksheet Events you can write code for. Mike F "Guye" wrote in message ups.com... Hi, I have written 2 seperate codes for 2 different worksheets. and i would like to apply each of them only on the relevant worksheet, both codes a Private Sub Worksheet_Activate how can i apply each code only for 1 worksheet ? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to work with ONLY active Sheet not all ? | Excel Programming | |||
vb code for renaming a work sheet with a cell reference | Excel Discussion (Misc queries) | |||
Condition Formatting - Work Sheet Event Code | Excel Programming | |||
Chart versus Work Sheet Code Failure | Excel Programming | |||
VB Code does not work when sheet or workbook is protected | Excel Programming |