Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default 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
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
Code to work with ONLY active Sheet not all ? Corey Excel Programming 2 October 9th 06 02:52 AM
vb code for renaming a work sheet with a cell reference John Britto Excel Discussion (Misc queries) 3 September 17th 06 07:12 PM
Condition Formatting - Work Sheet Event Code Danny Excel Programming 7 September 13th 06 07:05 PM
Chart versus Work Sheet Code Failure Nigel Excel Programming 2 April 18th 05 05:16 PM
VB Code does not work when sheet or workbook is protected novicevbaer[_5_] Excel Programming 1 August 25th 04 11:34 PM


All times are GMT +1. The time now is 09:18 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"