#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Macro Run

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

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro Run

Put in the sheet code of the BID sheet by right click sheet tabview
codecopy/paste this.
Now, each time you activate the BID sheet it will check to see if the cell
matches today's date. If so, it does nothing. If not, it enters today's
date. Is this what you want?

Private Sub Worksheet_Activate()
With Sheets("LOG IN").Range("BF5")
If .Value < Date Then .Value = Date
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"D@SE" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Macro Run

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro Run

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
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
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 07:20 PM.

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"