question about macro in excel

i have a macro that i want to run on different excel sheets.
i want to be able to choose it from every sheet.
how can i make it general?
thanks in advance,

Message posted from

1/1/2004 10:18:01 AM
excel 39879 articles. 2 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 47

Write your code against the activesheet.

Store the workbook with the code somewhere nice.

When you need the macro, open this file and tools|macro|macros...
and run your macro.

A lot of people save all their general utility macros into a file called
personal.xls and make sure that it's in their XLStart folder.

Then each time excel opens, this workbook also opens and the macros are

But after awhile, it gets difficult to pick out the macro you want from the list
in tools|macro|macros...

John Walkenbach has a neat technique that you may want to use that will add
another item to the worksheet menubar.  It works very nicely and looks

You can get John's MenuMaker workbook from:

TaLz wrote:
> hello,
> i have a macro that i want to run on different excel sheets.
> i want to be able to choose it from every sheet.
> how can i make it general?
> thanks in advance,
> tal
> ---
> Message posted from


Dave Peterson
ec35720 (10082)
1/1/2004 2:26:35 PM
Thanx :

Message posted from

1/6/2004 9:36:15 AM

Similar Artilces:

Excel 2003-provide feedback with sound
Trying to set in the options of MS Excel 2003 "provide feedback with sound", a message appears, that I have to download the Microsoft Sounds Add-in from the MS download page. But there is a hint, that this Add-in is only up to Excel XP and so it is not possible to install this feature. Is there any other version for MS Excel 2003? I installed Microsoft Office Sounds and it works in all versions from Excel 97 to Excel 2003. I didn't have to do anything special beyond selecting it under Options. So it "should" work. -- Jim Rech Excel MVP "Dirk" <Di...

Excel '97
Is it possible to purchas an original install copy of Excel '97 anymore? Hi try ebay -- Regards Frank Kabel Frankfurt, Germany "Jeanne" <> schrieb im Newsbeitrag news:003401c4f287$24f9e480$a401280a@phx.gbl... > Is it possible to purchas an original install copy of > Excel '97 anymore? I've tried Amazon and Ebay, and they both have UPGRADES available, but the original Office package wasn't part of the 97 OS was it? >-----Original Message----- >Hi >try ebay > >-- >Regards >Frank Kabel >F...

Export Access Record to Specific Cells in Excel
I'm looking for suggestions on how to export data from an Access table or Query into specific cells of a Worksheet. The table I'm importing will always contain a single record only. For example, I'd like to export data from Field1, field2...etc in an access table to Sheet2!A3, Sheet2!B3...etc. Any sugestions would be most appreciative. ...

How can i move a macro from one computer to another
i would like to move a macro from one computer to another i Excel Macros live in excel workbooks. So you can just copy that workbook with the macro to the other pc and open it there. TorToms wrote: > > i would like to move a macro from one computer to another i Excel -- Dave Peterson Or you could export the module containing the macro as a *.BAS file, email it to other computer then import to another workbook. Gord Dibben Excel MVP On Wed, 08 Sep 2004 07:05:48 -0500, Dave Peterson <> wrote: >Macros live in excel workbooks. > >So ...

Excel to publisher import
How can I import an excel spreadsheet to publisher doc.? If you want to insert the actual spreadsheet, you can go to Insert > Object > Create from file and browse to the Excel file. If you want to merge the contents of the cells, you can use the Mail Merge feature in Publisher. -- Brian Kvalheim Microsoft Publisher MVP This posting is provided "AS IS" with no warranties, and confers no rights. "Bill" <> wrote in message > How can I imp...

Excel 2007 and Word 2007 Hangs when using the File -> Open command
I have a couple users that when they have Excel 2007 or Word 2007 open, and click the File -> Open option, and choose a file, it either takes about 3 minutes to open the file or the program will crash. If they were to double click on the documents or spreadsheets, the doc or sheet will open right up. This is happening on the user's Hard drive as well as network drives. Once you get a file opened in Word or Excel, however, the next time you go to File -> Open, it's really fast to open the file. ...

Insert Macro
I've just seen a macro that I'd like to add into my current macro. Do I simply copy and paste to the bottom of my current macro? Thanks! If you're lucky, that would work. You may have to adjust variable names or even declare variable. Another way is to keep that macro as a different subroutine and just call it: sub yourexistingmacro() 'all your existing code call yournewmacro end sub sub yournewmacro() 'all that newstuff end sub Change "yournewmacro" to the correct name in both spots. And save your workbook before you test it. If it blows up real good...

Distribute macro to users
I have written a macro for a spreadsheet, chicago.xls. Let's call the macro testmacro. The users would like to be able to run the same macro for other spreadsheets (eg. denver.xls, dallas.xls, NewYork.xls, boston.xls, miami.xls etc..). So they'll open the spreadsheet, press a button and get the desired result. I have read some of the threads on putting a button on a floating toolbar. Debra Dalgleish's info is helpful but I'm just getting very confused. How can I give testmacro to the users so they can just press a button to run the macro? I am using Excel V...

Analysing data from several excel workbooks
Hi, I'm totally new to excel and i need to analyse the changes in a funding position across several years in a seperate excel sheet. As in, submissions are made year on year showing the amount of revenue spent on several different services. I need to be able to compare how those have moved over the last 5 years in a single spreadsheet. I appreciate any help. Thanks To give a clear answer we would need a bit more detail of the data layout Give us a simplified version of what the data looks like Your 'subject' talks about different workBOOKS but the text of the ...

Macro Security #3
In the process of building an Excel spreadsheet, I added a couple of macros. (Mistake #1, I know.) I don't really need the macros, so I deleted them and saved the file. But now when I go to re-open the file, I get that annoying little "Macros may contain viruses, it is always safe to disable macros, but if the macros are legitimate, blah, blah, blah..." dialog box. (There are no macros listed in the Macro dialog box when I do the ol' Alt+F8.) I know I can reset my security level to high and not have to deal with this, but I don't want to do that; I want Excel to recogn...

Macro to create a new chart
I've been using this code for a while to easily create a new chart. However just recently has stopped working. It now created a "default" excel chart as a new tab in the workbook. Any suggestions? '******************************************************************** 'Creates 2 data series horizontal bar chart '******************************************************************** Dim myShtName As String myShtName = ActiveSheet.Name Charts.Add ActiveChart.ChartType = xlBarClustered 'Creates Stacked bar ActiveChart.SetSourceData Source:=Rng, ...

Upgrade question
Hi I'm planning on upgrading both my OS ( to OS X 10.4.1 ) and my Office ( to 2004 ) at the same time. I'm planning to wipe my drive and update everything from scratch. My question is regarding updating the Office Professional installation. Will I need to install the earlier versions of Office and Virtual PC to make this go? I own Office X and Connectix Virtual PC 6 and have purchased the Office Professional upgrade. I'd prefer to not have to install the earlier versions if I can avoid it. Thanks Claude In article <d7finv$vrn$>,

Excel document changes format
Hi, I have an Excel document that changes format unexpectedly. It seems to change the format of the document eventhough i saved it. I have to resize the windows of the bar graphs, etc. It just doesn't save it the way i want. I re-installed MSOffice and re-did the NT profile, but still persists. Any ideas? Thanks. Excel does seem to have problems if the screen zoom is anything othe than 100%. Usually changing to 100 and back resets he screen display -- Message posted from ...

Too Many Excel Apps running
I recently installed Excel 2010. My operating system is XP Pro. Ever since I installed Excel 2010 I find that every time I open an Excel file it opens a new Excel. It is not unusual for me to have 5 different Excels open even after I close a file. My bottom ribbon is full of Excels! I previously used Excel 2003 and did not have this problem. I know these are different Excels operating because I am unable to open a split window to show two different files. Note - I usually open my files via Explorer. Is there a setting that I can use to require that my single open Excel can open any new Exce...

A print macro?
Hello. I am using Excel 2000. I have made a spreadsheet that will allow me to produce W2 forms. It works great, but I need some help with the printing. On one worksheet I have the information so that i can produce 100 W2's. I have 2 per sheet just like the real form. When I print preview I have a total of 50 printable pages. What I would like to do is to have a dialog box that I could type in page 1, page 2, etc. What my plan is to print 1 page at a time. I have to print 6 copies of each W2. I would like to type in a dialog box etc. "page 1" and have the macro know that I wa...

Question with local vs. remote (Exchange server) data
Can someone please explain something basic to me about the way Outlook works. I'm a Mac user and not familiar with this thing but now need to figure out how to synchronize it with a PocketPC PDA device. We've got Outlook on our PCs (W2K), connected to an Exchange server. So, I see my calendar and contacts, which I know live on the server. But when I sync my device, it ends up empty. Is there some sort of "local" (to my PC) data that it's using instead of the Exchange server's info? If so, where is it and how do I find it? If I could find it, I could copy the Exchan...

Linking Word and Excel #2
I have a Word document with a large number of tables linked to cells in an Excel spreadsheet. The tables in the worksheet are in the same order as those in the Word document. I would like to insert a new table between other tables linked to the Excel spreadsheet but when I insert the new table between the others in the Excel spreadsheet, it invalidates all the other linked information. I take this to mean that the links are not absolute references. Is there any way to do this without having to reconstruct the links? Thanks ...

pre-implimentation questions
I'm doing some design work prior to an in-house roll out of CRM 3 and thought it wise to post a couple of general questions. I'm trying to get a better feel for the recommended methods of handling the following scenarios. We will have several different types of contacts (e.g. "Staff" , "Supplier", "Neighbour" etc). A contact can be any combination of these types, i.e. they can be both a supplier and a staff member. If a contact is a staff member, then most users will only get to see a minimal set of data, even if the contact is also a supplier. The ...

can you date time stamp entries in excel
is it possible that when someone puts an entry on a shared worksheet in excel it can automatically date and time stamp their entry. Private Sub Worksheet_Change(By Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then With Target .Offset(0, 1).Value = Format(Now, "dd mmm yyy hh:mm") End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate ...

Excell 2007 messing up graphics
I have an invoice Excel sheet setup with my company logo on it. For some reason Excel 2007 messes it up during printing. It prints it about 10 times the size. I tried to re create the work sheet and it still will not print the graphic. It show it ok but will not print it. When I go to Print Preview the logo (JPG graphing) is not seen at all. Any Ideas what is going on? ...

Modify Protection Macro to allow formatting?
Option Explicit Sub UnprotectAll() dim wks as worksheet for each wks in activeworkbook.worksheets wks.unprotect password:="topsecret" next wks End Sub Sub ProtectAll() dim wks as worksheet for each wks in activeworkbook.worksheets wks.protect password:="topsecret" next wks End Sub How do I modify to allow users to format cells? Only been 4 minutes since your first post. Have a little patience. See reply at that post. Gord Dibben MS Excel MVP On Thu, 11 Feb 2010 11:14:02 -0800, Visakha <

how do i report a bug in excel
how do i report a bug in excel Hi Dave well if you'ld like to post here what you've found we can (probably) tell you if it is a known one already and maybe even suggest a solution or workaround. Cheers JulieD "dave" <> wrote in message > how do i report a bug in excel Or, as is often the case, not a bug at all but "just the way things work". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC "JulieD&q...

Excel & PDF
With Excel 2000 there was a PDF conversion function. Now I have Excel 2003 and there is no PDF converter. Is this right? I don't have a PDF conversion at work (xl2k). You sure your conversion software didn't come separate and installed itself as an option in excel (maybe with your Scanner/OCR???). Bob Purcell wrote: > > With Excel 2000 there was a PDF conversion function. Now > I have Excel 2003 and there is no PDF converter. Is this > right? -- Dave Peterson ...

How do I change the inverse colour in an Excel chart?
I want to have blue bars when the values are positive and yellow when they are negative. I have checked the box for "invert if negative" when choosing the colour in Format Data Series, but I still get blue for both. David, The concept described here should work: ---- Regards, John Mansfield "david_hutton.NO_SPAM" wrote: > I want to have blue bars when the values are positive and yellow when they > are negative. I have checked the box for "invert if negative" wh...

open excel 2007 refresh query from batch file
Hello all, I have a simple script saved as "C:\refresh_excel.vbs" that opens an Excel file, and does a refresh for a query on Sheet 1. I created a scheduled task to run this every day. It worked fine for previous versions of Excel, but since I have upgraded to Excel 2007 it doesn't work. Any help it helping me figure this out would be appreciated. /*contents of refresh_excel.vbs*/ Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set objWorkBook = objExcel.Workbooks.Open("C:\reports\UPS.xls") objWorkbook.Sheets("...