Run macro automatically.

How do I make a macro run automatically when a worksheet it is attached to is 
loaded?
0
Macro (4)
4/18/2005 6:40:03 PM
excel.newusers 15348 articles. 1 followers. Follow

7 Replies
1068 Views

Similar Articles

[PageSpeed] 19

right click on the sheet tab>view code>left window worksheet>right window
activate

-- 
Don Guillett
SalesAid Software
donaldb@281.com
"Excel macro" <Excel macro@discussions.microsoft.com> wrote in message
news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com...
> How do I make a macro run automatically when a worksheet it is attached to
is
> loaded?


0
Don
4/18/2005 6:50:00 PM
I am unable to find "activate " when I right click on worksheet. ( i assume 
that you are  referring to the windows explorer kind of interface which opens 
up on the left of the visula basic window) . Sorry! I am new to excel and 
many thanks for your quick response.

"Don Guillett" wrote:

> right click on the sheet tab>view code>left window worksheet>right window
> activate
> 
> -- 
> Don Guillett
> SalesAid Software
> donaldb@281.com
> "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message
> news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com...
> > How do I make a macro run automatically when a worksheet it is attached to
> is
> > loaded?
> 
> 
> 
0
sheela (5)
4/18/2005 7:24:02 PM
Hi

See Chip Pearson's site for more info
http://www.cpearson.com/excel/events.htm

Example code :

Sub Auto_open()
MsgBox "Hi"
End Sub

Must be in a normal module
If you use a Auto_open macro then this wil not run if you open the file with a macro

Or a event

Private Sub Workbook_Open()
   'macro name or code
End Sub

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel
Save and close the file



-- 
Regards Ron de Bruin
http://www.rondebruin.nl



"Sheela" <Sheela@discussions.microsoft.com> wrote in message news:2CA4C492-9A7D-43D0-B10D-FD84F6623B23@microsoft.com...
>I am unable to find "activate " when I right click on worksheet. ( i assume
> that you are  referring to the windows explorer kind of interface which opens
> up on the left of the visula basic window) . Sorry! I am new to excel and
> many thanks for your quick response.
>
> "Don Guillett" wrote:
>
>> right click on the sheet tab>view code>left window worksheet>right window
>> activate
>>
>> -- 
>> Don Guillett
>> SalesAid Software
>> donaldb@281.com
>> "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message
>> news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com...
>> > How do I make a macro run automatically when a worksheet it is attached to
>> is
>> > loaded?
>>
>>
>> 


0
rondebruin (3789)
4/18/2005 8:12:46 PM
You said worksheet. To us that means each tab within the workbook which is
the file....

-- 
Don Guillett
SalesAid Software
donaldb@281.com
"Sheela" <Sheela@discussions.microsoft.com> wrote in message
news:2CA4C492-9A7D-43D0-B10D-FD84F6623B23@microsoft.com...
> I am unable to find "activate " when I right click on worksheet. ( i
assume
> that you are  referring to the windows explorer kind of interface which
opens
> up on the left of the visula basic window) . Sorry! I am new to excel and
> many thanks for your quick response.
>
> "Don Guillett" wrote:
>
> > right click on the sheet tab>view code>left window worksheet>right
window
> > activate
> >
> > -- 
> > Don Guillett
> > SalesAid Software
> > donaldb@281.com
> > "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message
> > news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com...
> > > How do I make a macro run automatically when a worksheet it is
attached to
> > is
> > > loaded?
> >
> >
> >


0
Don
4/18/2005 10:33:13 PM
Thanks a bunch...It works. Also how do I make the macro run automatically 
whenever the value in a cell changes?

"Ron de Bruin" wrote:

> Hi
> 
> See Chip Pearson's site for more info
> http://www.cpearson.com/excel/events.htm
> 
> Example code :
> 
> Sub Auto_open()
> MsgBox "Hi"
> End Sub
> 
> Must be in a normal module
> If you use a Auto_open macro then this wil not run if you open the file with a macro
> 
> Or a event
> 
> Private Sub Workbook_Open()
>    'macro name or code
> End Sub
> 
> Right click on the Excel icon next to File in the menubar
> And choose View code
> 
> You are now in the Thisworkbook module
> Paste the Event in this place
> Alt-Q to go back to Excel
> Save and close the file
> 
> 
> 
> -- 
> Regards Ron de Bruin
> http://www.rondebruin.nl
> 
> 
> 
> "Sheela" <Sheela@discussions.microsoft.com> wrote in message news:2CA4C492-9A7D-43D0-B10D-FD84F6623B23@microsoft.com...
> >I am unable to find "activate " when I right click on worksheet. ( i assume
> > that you are  referring to the windows explorer kind of interface which opens
> > up on the left of the visula basic window) . Sorry! I am new to excel and
> > many thanks for your quick response.
> >
> > "Don Guillett" wrote:
> >
> >> right click on the sheet tab>view code>left window worksheet>right window
> >> activate
> >>
> >> -- 
> >> Don Guillett
> >> SalesAid Software
> >> donaldb@281.com
> >> "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message
> >> news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com...
> >> > How do I make a macro run automatically when a worksheet it is attached to
> >> is
> >> > loaded?
> >>
> >>
> >> 
> 
> 
> 
0
sheela (5)
4/19/2005 1:28:04 PM
use a worksheet_CHANGE event

-- 
Don Guillett
SalesAid Software
donaldb@281.com
"Sheela" <Sheela@discussions.microsoft.com> wrote in message
news:2C4540A3-6FAE-4632-ABA9-34EA27466F26@microsoft.com...
> Thanks a bunch...It works. Also how do I make the macro run automatically
> whenever the value in a cell changes?
>
> "Ron de Bruin" wrote:
>
> > Hi
> >
> > See Chip Pearson's site for more info
> > http://www.cpearson.com/excel/events.htm
> >
> > Example code :
> >
> > Sub Auto_open()
> > MsgBox "Hi"
> > End Sub
> >
> > Must be in a normal module
> > If you use a Auto_open macro then this wil not run if you open the file
with a macro
> >
> > Or a event
> >
> > Private Sub Workbook_Open()
> >    'macro name or code
> > End Sub
> >
> > Right click on the Excel icon next to File in the menubar
> > And choose View code
> >
> > You are now in the Thisworkbook module
> > Paste the Event in this place
> > Alt-Q to go back to Excel
> > Save and close the file
> >
> >
> >
> > -- 
> > Regards Ron de Bruin
> > http://www.rondebruin.nl
> >
> >
> >
> > "Sheela" <Sheela@discussions.microsoft.com> wrote in message
news:2CA4C492-9A7D-43D0-B10D-FD84F6623B23@microsoft.com...
> > >I am unable to find "activate " when I right click on worksheet. ( i
assume
> > > that you are  referring to the windows explorer kind of interface
which opens
> > > up on the left of the visula basic window) . Sorry! I am new to excel
and
> > > many thanks for your quick response.
> > >
> > > "Don Guillett" wrote:
> > >
> > >> right click on the sheet tab>view code>left window worksheet>right
window
> > >> activate
> > >>
> > >> -- 
> > >> Don Guillett
> > >> SalesAid Software
> > >> donaldb@281.com
> > >> "Excel macro" <Excel macro@discussions.microsoft.com> wrote in
message
> > >> news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com...
> > >> > How do I make a macro run automatically when a worksheet it is
attached to
> > >> is
> > >> > loaded?
> > >>
> > >>
> > >>
> >
> >
> >


0
Don
4/19/2005 2:52:59 PM
Hi sheela

See Chip's site
look for the change event

On this page you can see how you can use it
http://www.rondebruin.nl/mail/change.htm

-- 
Regards Ron de Bruin
http://www.rondebruin.nl



"Sheela" <Sheela@discussions.microsoft.com> wrote in message news:2C4540A3-6FAE-4632-ABA9-34EA27466F26@microsoft.com...
> Thanks a bunch...It works. Also how do I make the macro run automatically
> whenever the value in a cell changes?
>
> "Ron de Bruin" wrote:
>
>> Hi
>>
>> See Chip Pearson's site for more info
>> http://www.cpearson.com/excel/events.htm
>>
>> Example code :
>>
>> Sub Auto_open()
>> MsgBox "Hi"
>> End Sub
>>
>> Must be in a normal module
>> If you use a Auto_open macro then this wil not run if you open the file with a macro
>>
>> Or a event
>>
>> Private Sub Workbook_Open()
>>    'macro name or code
>> End Sub
>>
>> Right click on the Excel icon next to File in the menubar
>> And choose View code
>>
>> You are now in the Thisworkbook module
>> Paste the Event in this place
>> Alt-Q to go back to Excel
>> Save and close the file
>>
>>
>>
>> -- 
>> Regards Ron de Bruin
>> http://www.rondebruin.nl
>>
>>
>>
>> "Sheela" <Sheela@discussions.microsoft.com> wrote in message news:2CA4C492-9A7D-43D0-B10D-FD84F6623B23@microsoft.com...
>> >I am unable to find "activate " when I right click on worksheet. ( i assume
>> > that you are  referring to the windows explorer kind of interface which opens
>> > up on the left of the visula basic window) . Sorry! I am new to excel and
>> > many thanks for your quick response.
>> >
>> > "Don Guillett" wrote:
>> >
>> >> right click on the sheet tab>view code>left window worksheet>right window
>> >> activate
>> >>
>> >> -- 
>> >> Don Guillett
>> >> SalesAid Software
>> >> donaldb@281.com
>> >> "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message
>> >> news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com...
>> >> > How do I make a macro run automatically when a worksheet it is attached to
>> >> is
>> >> > loaded?
>> >>
>> >>
>> >>
>>
>>
>> 


0
rondebruin (3789)
4/19/2005 3:01:43 PM
Reply:

Similar Artilces:

Need only one DLL instance to run...
Hi all, 1: if two apps load the same DLL - LoadLibrary(...) - system will create to different instance of the DLL... Now, in my DLL i've a CList and i need it to be visible to all instance and all apps!!!! Is there a way!? 2: I need the dll to remain loaded till machine reboot!!! Is it possible!? Thanks Ale >if two apps load the same DLL - LoadLibrary(...) - system will create to >different instance of the DLL... >Now, in my DLL i've a CList and i need it to be visible to all instance and >all apps!!!! > >Is there a way!? It'll be difficult to share a ...

credentials to run this report are not stored
Hi all, I'm getting this problem when I try and create a timed subscription. Error: ...credentials to run this report are not stored..... ok I created another folder under the same folder where I'm having this problem. loaded the report and I have no problem. I even moved the current folder with that report in it. Creted another folder with the same name and still the same problem with that named folder. With a different name for the folder I have no problem??? I'm stuck here.. almost all post just talk about storing the credentials, Already done and works...

Hyperlinks and Automatic Filtering
I've built a hyperlink from one worksheet to another which works fine, but I want to automatically filter the data in the destination worksheet - can this be done? Thanks, Bob. There is a worksheet_activate event that you might be able to use to. It works in xl2002 when you go to a worksheet via hyperlink, but I recall an earlier discussion that said it didn't fire in either xl97 or xl2k. (bad memory!) Try right clicking on the worksheet tab that you jump to. Select view code and paste this in. Option Explicit Private Sub Worksheet_Activate() MsgBox "hi from " &...

Repost: Error running Report in an Access 2003 db from Access 2007
Ok, clarification - ignore the code from my original post, some of the reports do work. The ones that don't are reports that I have being filtered. Here is the code from one of those buttons: Private Sub Ok_Click() On Error GoTo Ok_Click_Err 'using the customer sub form for customer state report to filter the report, clicking ok will open report for selected state Dim stDocName As String Dim stLinkCriteria As String If Not IsNull(Me.Search_Results) Then stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"...

run time error 10-22-03
I am having a lot of trouble when I open up word I get run time error 52 in VB. I have tried uninstalling word and reinstalling it. WE have tried deleting the macro but still to no avail can someone help me please? ...

Automatically run macro
My name is Mike and i have a question about microsoft excel macro's. Attached is a copy of the excel sheet im working on. Below the excel sheet is the macro I built. Some of the cells contain given values and some cells are calculated from formulas. Cell (G4) is my given value...it is related to cell (C32). The point is, I plug a value into cell (C10) and it runs through the rest of the calcs in the other cells and gives me a value to cell (C32). I built a macro that works as a goal seek pretty much. The macro makes cell (C32) equal to cell (G4) and gives me the value for cell (C10). I wan...

Automatically display set text based on users composition
Hi, im trying to do something really simple, trouble is i dont know what the feature's called to be able to search for tips on how to do it. Basically in outlook messages, when a user begins writing a sentence e.g. "in the terms of" i need a tag to pop up that allows the user to press enter and then the remainder of what they will want to type in will be inserted in, its a yellow tag that comes up above the words. i dont know where it needs to be created and enabled. Cheers, Rhys. ...

display changing label caption on form as sub runs w/o screen flic
let's say i have this routine Sub Test label1.caption = "Starting ... " 'do events label1.caption = "Getting there ... " 'do events label1.caption = "Finished! ... " End Sub on my form, i have label1 right in the middle what happens is sometimes the message will change, and then sometimes it wont, or it will show the first one, skip the second and jump to the third etc etc etc so it is inconsistent. is there a way to make sure the label caption displays consistently, on time, wh...

Excel Continuous Running Total
I posted a message earlier and have received a partial solution. I want to keep track of how much stock prices go up or down with a running total of how much they go up or down over several days until the direction changes. For example, if price go up 10 on Mon, 20 on Tues, 30 on Thurs and down 10 on Fri I want my running total column to show a positive number of 60 and then a red number of 10 and continue adding the amount of the total of the down days until the market shows an up day. The formula I am now using total the first and second day but does not do a running total count if t...

macro which finds last cell in a column
please help me by telling a macro which finds last cell in a column thank -- Message posted from http://www.ExcelForum.com Dim LastRow as Long LastRow = Range("A65536").End(xlUp).Row or if you just want to select it: Range("A65536").End(xlUp).Select Regards Trevor "vikram >" <<vikram.15hp0w@excelforum-nospam.com> wrote in message news:vikram.15hp0w@excelforum-nospam.com... > please help me by telling a macro which finds last cell in a column > > thanks > > > --- > Message posted from http://www.ExcelForum.com/ > ...

Money 2002 will not run
I had been using Money 2002 for approx. 3 yrs on my home pc (Dell Dim 2100, XP Home Ed. w/SP2). Last year, it simply would not launch. No error message, no splash screen, no app opening, no process listed in Task Manager. Just.... nothing.... The only change that was made to the system since M2k2 last ran was upgrading my a/v solution from Trend Micro PC-Cillin to TM Internet Security. I have tried disabling every aspect of the Internet Security product, as well as completely un-installing the app, and then attempting to run Money, but the same thing (nothing) happens. I was considerin...

Re: Workflow just wont run automatically, i have to run them manually
Yes, but i realized what i was doing wrong. I assumed [bad idea] that if i create a case and hit Save & Close the first time, taht the rule will run. In order for the rule to run automatically, it has to be Save, once it saves it, then Save & Close. Thanks for your reply. "Hi, Did you check the workflow monitor to see if the rules get triggered correctly and complete sucessfully ? Have a nice day, St=E9phane Dorrekens " --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://...

No macros in 2008
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) I thought i was doing the right thing trying to convert to the whole office to Mac's! We run all our invoicing, accounts and stock on excel workbooks. they are now very complex and interlinked. I have automated the whole thing using macro and VBA and i feel right royally stuffed! <br><br><i>understand there is no easy or quick solution from what i have read on the forum. i do find it hard to believe such a useful function is just taken away.</i>&#32;<br><br>Can i run spreadsheets ...

Allow automatic forward
Hi We do not allow the automatic forwarding. Now I have two VIPs who want to be able to use the client based automated forwarding. The problem is, that we don't want to allow this to everyone. Is there a possibility to do that? Thanks and regards Peter On a per user basis - no. It's an all or nothing deal. You could enable it for particular recipient domains (that the vips want to forward to) by creating separate settings for those domains. This will, however, allow others to auto-forward to those domains as well. -- Bharat Suneja MCSE, MCT www.zenprise.com blog: www.suneja.com...

Macro to Find, Cut, and Paste
I have 2 LONG columns that I need to make into MANY. I want to find a word in the active column, cut from that word down to the end and the adjacent cells; then paste them at the top of the next column. and do this for all occurences of that word. I'm confused about the two columns. I'm thinking that you want to break up your list of two columns based on the word in column A. But paste both columns to the adjacent columns. So this: $H$1 $B$1 $H$2 $B$2 $H$3 $B$3 $H$4 $B$4 $H$5 $B$5 $H$6 $B$6 $H$7 $B$7 aaaa $B$8 $H$9 $B$9 $H$10 $B$10 $H$11 $B$11 $H...

Outlook Still Running
I am running XP Pro with Office 2003 Pro and sometimes when I exit out of Outlook, Outlook.exe and Winword.exe stay as processes still running. Does anyone else have this problem and what can do to make sure this does not happen? Thanks for your help -- Neil Remove ABCD from Email address to reply <neil154ABCD@earthlink.net> wrote: > I am running XP Pro with Office 2003 Pro and sometimes when I exit > out of Outlook, Outlook.exe and Winword.exe stay as processes still > running. Does anyone else have this problem and what can do to make > sure this does not happ...

Pivot tables and macros
i currently use macros to change some downloaded sales information. unfortunately, the volume always changes and I cannot use a macro for creaqting a Pivot table. When i select cell A1 and hit pivot tabel it automatically selcts the range. In my macro it will only select the actual range i recorded. IS there a way to go around that? Thanks Mike You'll have to edit the macro to create a variable range (alt + F11 will bring up the VB Editor). If, for example, your macro recorded the range as "A1:D4200", you'll want to create a variable to capture the final row, th...

CEditCtrl with automatic line feed
Hello NG, I hope someone can help. I already have been searching in the web but without success. I use a CEditCtrl, in which one can input several lines. When the input reaches the border, I want the text to "jump" into the next line, so that the user is not supposed to scroll (like here in my mail editor e.g.). Do you know if such a EditCtrl exists or how I can do it? Thanks in advance Guido "Guido Franzke" <guidof73@yahoo.de> wrote in message news:eZcKcnTbHHA.4720@TK2MSFTNGP04.phx.gbl... > Hello NG, > > I hope someone can help. I already have been se...

Very strange problems while running Great Plains on workstations
I notice that a few workstations in an office I support are having problems when they run Great Plains. Excel, Outlook, Word and Dynamics.exe are showing in the Application event log as being Hanging or Faulting. I also see Fault Bucket errors, but when I search online I cannot find any information online. Here is one of the Fault Bucket errors: 3:15:35 pm 28-Sep-06 Application Hang None 1001 N/A Fault bucket 296734104. Also, these workstations are experiencing problems printing PDF files. Has anyone out there seen this behavior and if so, how can these problems be fixed? Thank you, ...

Publisher 2000 will not run
I had problems with Publisher 98 not running which we=20 never did solve so I installed office 2000 to see if=20 Publisher 2000 would function. Same problem: The flash=20 screen pops up and then disappears. No program. Microsoft=AE Publisher 2000 Version 6.0 has encountered a=20 problem and needs to close. We are sorry for the=20 inconvenience. Howard, hi again, Have you tried opening Publisher in safe mode? Publisher retains all printer information within its publications. If you can open Publisher in safe mode, either regress or update your printer and video drivers. -- Mary Sauer MS MV...

Personal Macro file
How do I stop my Personal Macro file from requesting to be Saved each time I exit Excel? This is very annoying and has just started happening after creating some macros to update data from certain clients. -- Mickey If you put this is a standard module you will no longer be prompted to save changes: Sub Auto_Close() ThisWorkbook.Saved = True End Sub Or alternatively, this in the ThisWorkbook module: Private Sub Workbook_BeforeClose(Cancel As Boolean) Saved = True End Sub Of course, when you do need to save changes, you must remember on your own. -- Jim "Mikey" <...

Running diferent query with one command
I would like to run queries with just one botton and a date dispalyed in a form. If Sunday March 09, 2008, is dispalyed I would like to click on a button and run a query that will select emloyees that are scheduled to work on this day of the week along with other pertinent information already preselected by that query. Currenlty I am using 7 diferrent buttons to run 7 differnrent append queries but it is too confusing and I am sure there is an better way. Thanks Charles -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1 Why 7 butt...

Macro Warning #2
I've been working on a payroll spreadsheet, suddenly when I open it, I get the macro warning, but I haven't created any macros. Help? Are you using anything from the control toolbox? regardless, open the workbook, press alt + F11, in the project pane to the left check to see if you have any modules, if so right click it/them and select remove module, answer no when prompted, if there are no modules double click each sheet module and ThisWorkbook, delete whatever code might be in those, press alt + Q to close the VBE and then save the workbook. HTH -- Regards, Peo Sjoblom...

Macro automatic run at open
Is there a simple way to have a macro automatically started when a workbook is open? Thanks Francesco Francesco, use the workbook open event, like this, Private Sub Workbook_Open() MsgBox "It Works!" End Sub To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is at the top-left of the spreadsheet this will open the VBA editor to the thisworkbook module, then, paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook, now this will run every time you ...

Win 7 Pro running 64 bit with Outlook 2007. Problem: frequent cras
I have a brand-new computer with i-7 processors and 8 GB of RAM running Win 7 Pro 64-bit. At the time of upgrading to new computer, i upgraded office 2003 to 2007. For the first month, all was well. Suddenly, my computer started crashing regularly, as in every 30 minutes. The screen would go blank, the mouse and keyboard wouldn't work, and I would have to do a hard reboot. The store where i bought the PC has done everything imaginable to try to isolate the problem. They have swapped out every component, including the RAM, motherboard, power supply, video card and all ca...