PC Review


Reply
Thread Tools Rate Thread

Code for Work Sheet

 
 
Guye
Guest
Posts: n/a
 
      10th Apr 2007
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 are:

Private Sub Worksheet_Activate

how can i apply each code only for 1 worksheet ?

thanks

 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      10th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 are:
>
> Private Sub Worksheet_Activate
>
> how can i apply each code only for 1 worksheet ?
>
> thanks
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      10th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 are:
>
> Private Sub Worksheet_Activate
>
> how can i apply each code only for 1 worksheet ?
>
> thanks
>



 
Reply With Quote
 
Mike Fogleman
Guest
Posts: n/a
 
      10th Apr 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 are:
>
> Private Sub Worksheet_Activate
>
> how can i apply each code only for 1 worksheet ?
>
> thanks
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to work with ONLY active Sheet not all ? Corey Microsoft Excel Programming 2 9th Oct 2006 02:52 AM
Condition Formatting - Work Sheet Event Code =?Utf-8?B?RGFubnk=?= Microsoft Excel Programming 7 13th Sep 2006 07:05 PM
Code won't work if activesheet is a Chart Sheet Barry Pettis Microsoft Excel Discussion 3 16th Sep 2004 03:25 PM
VB Code does not work when sheet or workbook is protected novicevbaer Microsoft Excel Programming 1 25th Aug 2004 11:34 PM
Passwork to look at code for Invoice1,xls work sheet John Davis Microsoft Excel Worksheet Functions 1 11th Jul 2003 10:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 AM.