Macro

Can anybody tell me how to kick off a macro automatically as file is opened?

Regards


0
7/2/2003 4:14:03 PM
excel 39879 articles. 2 followers. Follow

0 Replies
2185 Views

Similar Articles

[PageSpeed] 12

Reply:

Similar Artilces:

macro won't run
I have placed some buttons on my sheet that run some simple filtering macros.... I wish to protect the sheet from change, but when it is protected my buttons will not run the macros... have tried various secuity options without success.... any ideas? thanks much D Unprotect at the beginning of the button code and re-protect at the end. --- Message posted from http://www.ExcelForum.com/ Dave, Curious. I've not had trouble with buttons on protected sheets assigned to macros. Long shot: put a break (F9) in the first executable line of code do determine if it's at least getting i...

using search in a macro
Hello, hoping for some help. I have macro to search for a specific bit of data in my spreadsheet but when excel can't find it (because it may not be there) I would lik the macro to stop instead of collapsing and giving me this Error 91 an then "cannot find data blah blah blah" messagebox. Any ideas -- Message posted from http://www.ExcelForum.com Have a look in vba HELP for error, then on error statement -- Don Guillett SalesAid Software donaldb@281.com "Matt Houston >" <<Matt.Houston.1c7s5g@excelforum-nospam.com> wrote in message news:Matt.Houston.1c7...

Macros
I was wondering if theres a way to have 2 functions in a macro button. For example, I want to make the macro open up "Set Customer" (F7) and after selecting a customer it goes straight to "Tender" (F12). no. you could do it as a hook, but it doesn't sound like good idea! -- -Jerry JR Data Inc. "Mike" wrote: > I was wondering if theres a way to have 2 functions in a macro button. For > example, I want to make the macro open up "Set Customer" (F7) and after > selecting a customer it goes straight to "Tender" (F12). ...

How can I suppress prompts during macro run?
I created a macro which in which I delete a sheet (tab). During the run I get a prompt if I want to delete the sheet. How can I build in that I don't get a prompt or that I can answer automatically? I have the same problem when saving. I overwrite an existing file and I'm prompted if I want to overwrite, which I want. How can I suppress these prompts or answer automatically? Thank you for helping me out on this!! Andor Precede the delete with Application.Displayalerts = False and reset to True afterwards -- HTH Bob Phillips (remove nothere from email address if mailing di...

Macro quesetion
Is there a way to have a macro run based on the condition of a cell or a toggle button? Examlpe, if Type = Local then the macros on sheet 2 that are needed for long estiamtes will automatically run. I'm not sure what you're asking, but if that cell changes by typing, you could use a worksheet_change event to fire the other macros. If you want to read more about these kinds of events: Chip Pearson's site: http://www.cpearson.com/excel/events.htm David McRitchie's site: http://www.mvps.org/dmcritchie/excel/event.htm If you meant you wanted to check in your macro for the v...

Excel Macro does not Replace text in formulas for several workshee
Dear all, having tried to REPLACE "=" with "&" (to inactivate and activate an add-in formula) in two different worksheets of the same workbook, the "replace function" (see below macro) only works in the first (active) worksheet. Suggestions?: Sub Macro1() Columns("B:E").Select Selection.Replace What:="=INF", Replacement:="&INF", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Sheets("Sheet 2").Select Application.Goto Reference:...

Repetitive macros
I have a large mailing listing that I have to delete names from. I have created a macro that "finds" CPA and deletes the entire row from the spreadsheet. How do I make this macro continue throughout the spreadsheet without running it by hand every time? I am running Excel 2007. Thanks, -- rcarolina Look in the vba help index for FINDNEXT -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "rcarolina" <rcarolina@discussions.microsoft.com> wrote in message news:60752F79-5B58-446D-8C03-BCB0EB8198E0@microsoft.com... >I h...

Macro warning (upon opening)
How do you get rid to the macro warning? I have deleted all macros in the file and saved changes. When I reopen the file, the message still pops up. When I go to the macro section, there are no macros to select. There are not any in my personal workbook, or current open workbook. Is this an issue of, once a macro is attached the warning message is permanent? Separate question: Where is the code to execute the macro with a shortcut? I see the option when creating, but have not found any code to carry out the command. Richard You have workbook modules, sheet modules, and regula...

Macro help 12-22-09
Hi, i need a macro to drag down some cells till the last active cell in "G" column. Ex: M N O 08:00:00 12:30:00 08:30:00 I need to select M1:O1 and to drag down till the last cell with some data in column "G". Can this be done? Thanks! Hi, Try this Sub FillUp() Dim x As Long lastrow = Cells(Cells.Rows.Count, "G").End(xlUp).Row Range("M1:O1").AutoFill _ Destination:=Range("M1:O" & lastrow), Type:=xlFillDefault End Sub Mike "puiuluipui" wrote: > Hi, i need a macr...

Programming a macro in Excel Office 2007 to create Pivot Table
In Excel 97-2003, I had created in a macro to create a pivot table from a range of data. However, when I converted the file to Excel in Office 2007, I get VBA errors. The converted workbook is now an xlsm file with macros enabled. Not sure what else to do. The VBA error is: Sheets.Add ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "Loans!R8C2:R416C55", Version:=xlPivotTableVersion12).CreatePivotTable _ TableDestination:="Sheet1!R3C1", TableName:="PivotTable1", DefaultVersion _ :=xlPivotTabl...

Excel 2007 Macro shortcut key doesn't work but menu selection does
I have a very short set of Macro's one of my users has recorded. All of them worked at first but now one of them will not function via the shortcut key. It will function if you select and run it by using alt-f8, clicking on it then run. Out of curiosity I reinstalled office, same problem. Then I even gave him a new PC to play with. He recorded the macros and they ran fine for many days then the same problem recurred. Any thoughts? Thanks, Does the macro open another workbook? Does the shortcut key include the shift key? Does the macro actually start, but stop right ...

How to delete Macro (double click on form field event)
I did a macro and now want to delete it. The macro opens frmDetails when the client double clicks on a field in frmQuickView I've clicked on View | Code and then clicked on frmQuickView but can't find the code for the Macro or how to delete it. thanks for any help. Mel Woops! I see it.Click on Macro's in the design window and hit delete. Sorry gang. ...

Macro to hide/unhide WS based upon WS tab color
I have this macro to hide all WS that have red tabs. But it dosn't work. It only hides one tab when there are many that are red. What is wrong? Sub Hide_shts() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets If ws.Tab.Color = 255 Then ws.Visible = False End If Next End Sub Thanks, Joe M. See your OTHER posts -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Joe M." <JoeM@discussions.microsoft.com> wrote in message news:08D7C94F-D90E-4651-8FF4-3EA8BC4855E1@microsoft.com... >I have this macro t...

Calling AutoFit using macro in XLCALL.h
Hi Is there a way to call the AutoFit function of Excel using one of the macros defined in the XLCALL.h file? I am trying to do this from inside a VC++ app. Any help is welcome. Thanks Why not post a follow up to any of the posts you've made before? comptechguy76@gmail.com wrote: > > Hi > > Is there a way to call the AutoFit function of Excel using one of the > macros defined in the XLCALL.h file? > > I am trying to do this from inside a VC++ app. > > Any help is welcome. > > Thanks -- Dave Peterson ...

Run function at start-up...macro?
Hi all, I can not find the best solution for the following: I have a function CheckConnection() which should check if the backend data is still there/connected. I want this function to run as very first action when the database opens. I thought to put it in the macro autoexec (feels like old DOS times) and using Openfunction, this keeps asking for a table etc. I would just like to find a method to run a user-defined function direct as Access starts. I am not familiar with macros since I never use them because I feel more covetable with VBA. Any suggestions will be appreciated a lot. ...

Macros #3
I am looking for help with Macros. I have recorded a macro in xl2k that opens a 2nd spreadsheet, copies information from the first to the 2nd spreadsheet and then saves and closes the 2nd spreadsheet. The problem I am having is writing into the macro that I want the data to copy to the first open row instead of copying over the data that exists from the last time the macro was run... I'm sure it can be done. I just don't know how to do it. Thanks for any help in advance... Andrea Andrea This macro will find the bottom row of data in Column A on Sheet2 then select the firs...

Macro Upon Opening Then Close
I am hoping to create a macro that upon opening a file it will do the following: 1)Copy A1:B:2 (just as an example; also - there is only one worksheet in this file) 2)Activate Workbook "Price Chart Template" (only 1 sheet here too) 3)Paste on A:1 4)Go back to the original document and close it without saving (this is where I'm wondering if code can allow to close the document it is written in???) Thank you. -- David P. Workbooks("name1").Sheets(1).Range("a1:B2").Copy Workbooks("name2").Sheets(1).Range("a1").paste Workbooks("nam...

Querying external data thru macros
Hallu, I'm trying to import some external data, and my query for it is that it needs to be a specific date. I was wondering if i could write a macros so, when i run it there will be a inputbox that pops up asking which date i would like to query for before it imports the data. Any ideas?Thanks, bLySs --- Message posted from http://www.ExcelForum.com/ bLySs (This in XL2003, don't know if this will effect anything)... Maybe you can extract the relevant from the code below, which I set up this morning. It queries an access database on my hard drive called test.mdb, takes two field...

Run macro after booting is over
Is it possible to run a macro when I turn on my PC? e.g. I want my list of duties to be undertaken today. This list is saved in an excel file. I have excel sheets by date. Hi, This is as much a Windows question as an Excel one but yes you can do that. Place a shortcut to the Excel file in the startup directory of your personal start menu and Excel will run that file on startup. Once running you can call macro using the workbook open event -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still suffic...

Command Button Clears Text Field But Get "Can't Find the Macro" Error
Hi, hope someone can help me with a problem I can't seem to solve. I have a form with a command button which adds a new record on a form. On the form, I also have two unbound text boxes that I need to clear when I click on the command button to add a new record. When I click on the command button, the fields clear, but I get an error that states that access can't find the macro; but I've not created any macros. Along with the code that Access put in for the add new record button, I also used the following code: Dim ctl As Control On Error Resume Next For Each ctl In Me.Contr...

Help with speeding up macro
Evening all, A colleague and I are just having some issues with a macro's speed in Excel 2003 (in '07 it takes about 1m40, which I could live with, but in 03, I've not managed to wait it out till the end yet...). Basically, what we're doing is devising a costing model for a college so that it can apportion overheads into courses. This requires using various drivers (three to be precise) and taking percentages so that the split accuratly reflects the activity undertaken by each course. Anyway, that's just some background that will probably be of no use. But t...

Need to add data to the bottom of a column using macro
I have data that I am importing from another program (see sample 1 below). This data will be changing values as well as number of rows each time I export. I need a way to determine the last line as the number of rows varies and then insert static as well as dynamic information. (See sample 2) In the first column I will be inserting "02" on the last row. In the second column i will be inserting the same numbers "150080380549" on the last row. On the 3rd column I need to count the number of rows (excluding the last line)and place this figure. On the 4th column, I...

File name change macro problem
I have a macro which when you press a button opens another excel file to cross-check and keep both open as two are linked via VLOOKUP, however, the "Estimate MASTER v2.4" file name changes by user and save as to the relevant estimate number and it then macro seems to throw a wobbly due to file change - is there any way to just tell it to look for open document not the file name "Estimate MASTER v2.4"??? "P:\01 Estimates\01 Estimate Record Book\Estimate Book.xls" Windows("Estimate MASTER v2.4.xls ").Activate End Sub Sorry not very good in VB...

macro #2
I would like to create a macro that , when run, will open a new email address it and have a message already typed in the body. I can't understand code. Any chance of making this happen? If you don't understand code, there's little chance of making this happen in a way that you'll understand what's going on. If you want to make a little bit of effort to understand, the first step is to tell us your Outlook version. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www....

Excel
I am trying to have 1 of 8 different macro's run depending on the value of a specific cell. If I enter 1 in cell A3, I would like macro1 to run. If I change cell A3 to 2, I would like macro2 to run and so on all the way up to entering 8 and getting macro8 to run. I am unable to find any good examples of how to do this. I realize I will probably have to use Worksheet Event to do this but what is the macro code I will need. Right click the sheet tab and select veiw code. Paste the following: Private Sub Worksheet_Change(ByVal Target As Range) With Target If .Addre...