Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default specific macro on specific sheets

My workbook cointain54 sheets.
Sheet names in ascending order a Main, Content, Micro, Help, NN1,
NN2,....,NN50.
I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC.
I want to run specific macro on specific sheet as shown below, evenif what
ever sheet is active.
Macro Main & Content on sheet Main & Content respectively.
Macro Micro1 & Micro2 one by one on Sheet Micro.
Macro Help on sheet Help.
Macro NNA,NNB,NNC one by one on Sheet NN1 to Sheet NN50

Please sugest some code which i can put at the starting of specific macro so
that it can run.




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default specific macro on specific sheets

Hi,

Sheets("Main").Activate

You can start the macro from any sheet but it will move the the Main sheet
if you put this line near the top of the macro. similar lines for all the
macros.

--
Thanks,
Shane Devenshire


"Harshad" wrote:

My workbook cointain54 sheets.
Sheet names in ascending order a Main, Content, Micro, Help, NN1,
NN2,....,NN50.
I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC.
I want to run specific macro on specific sheet as shown below, evenif what
ever sheet is active.
Macro Main & Content on sheet Main & Content respectively.
Macro Micro1 & Micro2 one by one on Sheet Micro.
Macro Help on sheet Help.
Macro NNA,NNB,NNC one by one on Sheet NN1 to Sheet NN50

Please sugest some code which i can put at the starting of specific macro so
that it can run.




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default specific macro on specific sheets

Dear Shane,
Thank you,
It's worrking.

But i want to know what code i should put so that macro NNA, NNB & NNC runs
on more than one Sheet namely NN1 to NN50.

Thanks in advance



"ShaneDevenshire" wrote:

Hi,

Sheets("Main").Activate

You can start the macro from any sheet but it will move the the Main sheet
if you put this line near the top of the macro. similar lines for all the
macros.

--
Thanks,
Shane Devenshire


"Harshad" wrote:

My workbook cointain54 sheets.
Sheet names in ascending order a Main, Content, Micro, Help, NN1,
NN2,....,NN50.
I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC.
I want to run specific macro on specific sheet as shown below, evenif what
ever sheet is active.
Macro Main & Content on sheet Main & Content respectively.
Macro Micro1 & Micro2 one by one on Sheet Micro.
Macro Help on sheet Help.
Macro NNA,NNB,NNC one by one on Sheet NN1 to Sheet NN50

Please sugest some code which i can put at the starting of specific macro so
that it can run.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default specific macro on specific sheets

How about something like this

Sub Test()
Dim WS As Worksheet
Dim WB As Workbook

Set WB = ActiveWorkbook

For Each WS In WB.Worksheets
If LCase(WS.Name) Like "nn*" Then
Call NNA
Call NNB
Call NNC
End If
Next WS

End Sub
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Harshad" wrote:

Dear Shane,
Thank you,
It's worrking.

But i want to know what code i should put so that macro NNA, NNB & NNC runs
on more than one Sheet namely NN1 to NN50.

Thanks in advance



"ShaneDevenshire" wrote:

Hi,

Sheets("Main").Activate

You can start the macro from any sheet but it will move the the Main sheet
if you put this line near the top of the macro. similar lines for all the
macros.

--
Thanks,
Shane Devenshire


"Harshad" wrote:

My workbook cointain54 sheets.
Sheet names in ascending order a Main, Content, Micro, Help, NN1,
NN2,....,NN50.
I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC.
I want to run specific macro on specific sheet as shown below, evenif what
ever sheet is active.
Macro Main & Content on sheet Main & Content respectively.
Macro Micro1 & Micro2 one by one on Sheet Micro.
Macro Help on sheet Help.
Macro NNA,NNB,NNC one by one on Sheet NN1 to Sheet NN50

Please sugest some code which i can put at the starting of specific macro so
that it can run.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default specific macro on specific sheets

Dear Barb,
It's not solving my problem.

Some other code pls.

Rgds,
Harsahd

"Barb Reinhardt" wrote:

How about something like this

Sub Test()
Dim WS As Worksheet
Dim WB As Workbook

Set WB = ActiveWorkbook

For Each WS In WB.Worksheets
If LCase(WS.Name) Like "nn*" Then
Call NNA
Call NNB
Call NNC
End If
Next WS

End Sub
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Harshad" wrote:

Dear Shane,
Thank you,
It's worrking.

But i want to know what code i should put so that macro NNA, NNB & NNC runs
on more than one Sheet namely NN1 to NN50.

Thanks in advance



"ShaneDevenshire" wrote:

Hi,

Sheets("Main").Activate

You can start the macro from any sheet but it will move the the Main sheet
if you put this line near the top of the macro. similar lines for all the
macros.

--
Thanks,
Shane Devenshire


"Harshad" wrote:

My workbook cointain54 sheets.
Sheet names in ascending order a Main, Content, Micro, Help, NN1,
NN2,....,NN50.
I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC.
I want to run specific macro on specific sheet as shown below, evenif what
ever sheet is active.
Macro Main & Content on sheet Main & Content respectively.
Macro Micro1 & Micro2 one by one on Sheet Micro.
Macro Help on sheet Help.
Macro NNA,NNB,NNC one by one on Sheet NN1 to Sheet NN50

Please sugest some code which i can put at the starting of specific macro so
that it can run.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default specific macro on specific sheets

Daer all,

My workbook cointain54 sheets. i don't want to run all the macro to each
sheet.
Some descreption:
Sheet names in ascending order a Main, Content, Micro, Help, NN1,
NN2,....,NN50.
I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC.
I have solved to run Main, Content, Micro and Help macro by following code.

Sheets("Sheet Name").Activate

But problem is for remaining Three Macro NNA, NNB and NNC.
NNA, NNB and NNC are
What i should put in a code, that runs my all three NN* macro through sheet
NN1 to NN50.


"Harshad" wrote:

My workbook cointain54 sheets.
Sheet names in ascending order a Main, Content, Micro, Help, NN1,
NN2,....,NN50.
I have macros name: Main, Content, Micro1, Micro2, Help, NNA, NNB, NNC.
I want to run specific macro on specific sheet as shown below, evenif what
ever sheet is active.
Macro Main & Content on sheet Main & Content respectively.
Macro Micro1 & Micro2 one by one on Sheet Micro.
Macro Help on sheet Help.
Macro NNA,NNB,NNC one by one on Sheet NN1 to Sheet NN50

Please sugest some code which i can put at the starting of specific macro so
that it can run.




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
Not allowing to continu unless a specific cell has specific answer madubois9 Excel Discussion (Misc queries) 3 October 25th 07 12:45 AM
Link to specific cell in specific Excel file JeroenM Excel Discussion (Misc queries) 3 July 6th 07 10:08 AM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
Highlight a row if a specific cell is specific numbers/words sea0221 Excel Worksheet Functions 2 March 9th 05 12:06 AM
How do I make a cell date specific to input a value on a specific. ebuzz13 Excel Discussion (Misc queries) 1 January 18th 05 05:53 PM


All times are GMT +1. The time now is 08:33 AM.

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

About Us

"It's about Microsoft Excel"