Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am kind of green here. I have various macros in a workbook and i want one
particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I meant
Right click the sheet tab of the worksheet you want to call the macro, view code and paste this in. "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Mike, it seems to work but when i click the tab it goes to the tab
where it is to do the macro function and the screen flashes for 5 or 10 seconds and then it comes back as it should. i do not understand it. -- David "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i think every time it comes back to my tab it is trying to run through the
whole process again and again. -- David "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
It will only call your code once but without seeing what your code is I think the best solution might be Sub YourSub() Application.screenupdating=false 'Your code application.screenupdating =true end sub Mike "D@SE" wrote: i think every time it comes back to my tab it is trying to run through the whole process again and again. -- David "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for your help. When i click on tab titled "BID" , it is to go run a
macro titled "NOW" which puts the date on tab "LOG IN" in cell BF5 and then returns to tab "BID". Here is my code, ' Sheets("LOG IN").Select Range("BF5").Select ActiveCell.FormulaR1C1 = "=NOW()" Range("BG5").Select Range("E11:E12").Select Sheets("BID").Select End Sub thank you so much -- David "Mike H" wrote: Hi, It will only call your code once but without seeing what your code is I think the best solution might be Sub YourSub() Application.screenupdating=false 'Your code application.screenupdating =true end sub Mike "D@SE" wrote: i think every time it comes back to my tab it is trying to run through the whole process again and again. -- David "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
i think every time it comes back to my tab it is trying to run through the
whole process again and again. It will do that because you asked for that I want one particular macro to run each time a particular tab is clicked. Mike "D@SE" wrote: i think every time it comes back to my tab it is trying to run through the whole process again and again. -- David "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
As i said i know i am green. How do i make it run the macro only once and
land back on my tab without running it again and again? I hate to be a bother here and do appreciate your help to a green horn. -- David "Mike H" wrote: i think every time it comes back to my tab it is trying to run through the whole process again and again. It will do that because you asked for that I want one particular macro to run each time a particular tab is clicked. Mike "D@SE" wrote: i think every time it comes back to my tab it is trying to run through the whole process again and again. -- David "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Simplify your macro to this, it's selecting the sheets and then re-selecting BID that causes the macro to execute twice Sheets("LOG IN").Range("BG5").FormulaR1C1 = "=NOW()" Mike "D@SE" wrote: As i said i know i am green. How do i make it run the macro only once and land back on my tab without running it again and again? I hate to be a bother here and do appreciate your help to a green horn. -- David "Mike H" wrote: i think every time it comes back to my tab it is trying to run through the whole process again and again. It will do that because you asked for that I want one particular macro to run each time a particular tab is clicked. Mike "D@SE" wrote: i think every time it comes back to my tab it is trying to run through the whole process again and again. -- David "Mike H" wrote: Hi, Right click the sheet tab of the worksheet you want to call the macro and paste this in. I've assumed you macro is in a general module. Change MySub to the name of your sub Private Sub Worksheet_Activate() Call MySub End Sub Mike "D@SE" wrote: I am kind of green here. I have various macros in a workbook and i want one particular macro to run each time a particular tab is clicked. i have read other similar questions and responses and can not seem to follow. i guess i need a little more detail. Thank you so much. -- David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
need help to update macro to office 2007 macro enabled workbook | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |