|
Insert Macros into an Excel Workbook or File and Delete Macros from Excel
Video | Similar Helpful Excel Resources
This video tutorial shows you how to insert a macro you may find on the internet into your Microsoft Excel workbook or spreadsheet. This is a step-by-step tutorial which walks you through copying the macro from a web page to pasting that into a module, ThisWorkbook, or an individual worksheet. You will also learn how to view all the macros present in Excel and how to delete any macros from excel, including the module in which they were contained.
Topics Covered
 Insert Macro into an Excel Module, ThisWorkbook, and a Worksheet  View Macros in Excel  Delete Macros from Excel  Delete a Module from Excel
Difficulty: Intermediate
Video: Yes
|
Got a Question? Ask it Here in the Forum.
Similar Helpful Excel Resources
I had a macro in the file, and then subsequently deleted it from the Tools->Macro menu. I saved the file after doing this, and when I reopen the file Excel still gives me the Macro Warning and asks if I want to Enable/Disable Macros. Why does it do this after I have deleted the only Macro?
How can I prevent this from happening?
Thanks
This is my first time working with macros and my project is finally complete! I am ready to share it yet would like all of the macros and formulas protected.
I have to set certain images and cells (which have macros) as unprotected so they can run. As of right now many of these objects can still be moved and manipulated to allow the macros to run but they will not save since the workbook is protected (which is a good thing).
Also, everyone I share this with will have to set their security level to low to run all of the macros. I thought of using the digital signature but IT Support shot that idea down.
Any ideas on how to protect everything while still sharing the file with ease? Or is what I currently have in place suffice?
Thank you in advance for any advise!
Help!
This is the similar problem as mentioned by Delbert on 12/12/2005 that
whenever they open a particular Excel file, it gives them a "Send Report
Error." Weird thing
about it is it doesnt happen in all other Excel files, only happens to this
file when saving as usual and trying to reopen it shortly after that. It
happens on my machine and my friend working on the same file also.
Details:
OS: Winxp
Office 2003 SP2
Files are saved in local drive
Files are around 12MB size (varies)
Files have Macros imbedded
Files have links
While opening, the dialogue box appears twice, asking for Enabling or
diabling macros, then crash (excel repair the error though, but all macros
and most formulas are gone, the log file is attach )
I have patched Office (SP2), and tried to use Excel safemode and other
methods mentioned in Delbert's thread, but excel still crashes, I doubt
wheather it is due to in this very workbook, there are several worksheets
containing a large amount of data, while in others, several macros. Will it
work if I seperate data and macros into two seperate workbooks?
Any solutions? Or those who have encountered this problem? Thank you!!
Microsoft Office Excel File Repair Log is shown as follows:
******************
Errors were detected in file
'C:\DOCUME~1\Owner\LOCALS~1\Temp\Rar$DI00.687\GSIM4x42005_1230.XLS'
The following is a list of repairs:
Damage to the file was so extensive that repairs were not possible. Excel
attempted to recover your formulas and values, but some data may have been
lost or corrupted.
******************
Hi All
I need to create a macro that creates a pie chart and moves it to a new worksheet, it successfully does it first time but wont work again.
i thought i'd make a macro that just deletes the worksheet so the macro can be run again but the worksheet is never named the same so how can i make it happen?
any help would be appreciated.
Peter.
Hi there everyone,
I have a sheet (uploaded for you to see below) where in order to create a standardised cover sheet for my quotations, I would like the quoting engineer to select the relevant details, which are then inturn entered into the final cover sheet. I have a few points, but they are similar, so I have included them all in one post. (if there is too much feel free to tell me off!)
Reset Form Help.
As you can see this button resets the form removing all data that has been entered and sorts the CRM into alphabetical order, it works well, but how do I add a popup to check that the user wants to run this marco and can cancel if needed? I would also like the macro to run a check that the contact names are all in the first avalible contact place, i.e. a contact has not been place in the 2nd place when the 1st place is free.
Step 3b "Add to database". I would like the macro to check the validity flag (not yet complete but started on cell K41) and if ok, enter the information into the relevant cells from column AI to BO.
I was thinking that if I recorded a macro and just started at the top and Ctrl "dwn" on the column AJ, followed by "dwn" "rght" I would be at the right place to start, but i would have to repeat the same action over and over again. If find the first unused row, then mark the cell value as a variable, I can return there much quicker. is this the right sequence, and if so how can that be realised in VBA?
I would also like some help on the Macro buttons "add contact to company details". This is used when you are quoting a different contact in the same company. If the company exsists in the CRM, but the contact is not created, I would like the user to have the option of adding the contact by clicking this button. The macro must then:
-find the correct company details
-add the contact and their email address to the next avalible contact slot
-save the update so the next people have access to that contact
I have added a column that will tell you exactly how many contacts are currently added for that company, however I am not sure how to include this value in my code to use the next unused space.
Any help would be a great help.
Kind regards,
Ste
Hi All,
Need your help badly.
I trying to run a macro automatically every time I open the excel workbook file using below code. But it seem not working.
I also try using "Run "Duedate_alert", Call Duedate_alert & etc but it still dont work.
Hope someone can help on this.
Code:
'Option Explicit
'Private Sub Auto_Open()
'
' MsgBox "This is auto open macro in Module"
'
'End Sub
Private Sub Workbook_Open()
Duedate_alert
End Sub
Sub Duedate_alert()
Dim LRow As Integer
Dim LResponse As Integer
Dim LName As String
Dim LDiff As Integer
Dim LDays As Integer
Dim LInvoice As String
LRow = 5
Dim MaxRowNumber As Integer
MaxRowNumber = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).row
'Warning - Number of days to check for expiration
LDays = -5
While LRow < MaxRowNumber
'Check the data in column C
If IsError(Worksheets("export").Range("AB" & LRow).Value) Then
Else
'Only check for expired certificate if value in column AC is not blank
If Len(Worksheets("export").Range("AB" & LRow).Value) > 1 Then
LDiff = DateDiff("d", Date, Worksheets("export").Range("AB" & LRow).Value)
If (LDiff < LDays) And Len(Worksheets("export").Range("AC" & LRow).Value) < 1 Then
'Get subcontractor name
LName = Worksheets("export").Range("A" & LRow).Value
LInvoice = Worksheets("export").Range("C" & LRow).Value
LResponse = MsgBox("The Due Date for " & LInvoice & ", " & LName & " has been expire in " & LDiff & " days.", vbCritical, "Warning")
End If
End If
End If
LRow = LRow + 1
Wend
MsgBox "No Over Due Found! " & vbCrLf & "Payment Received In Time *\(^_^)/* "
End Sub
I have an Excel sheet at work with macros attached to it. I saved the
worksheet as a different file name so I could make changes. Now anytime I try
to execute any of the macros in the original worksheet, it first opens the
file that I "saved as" before it'll execute the macro. I deleted the file
that I'd "saved as" and now it won't execute a macro at all. It gives me an
error message saying it can't find a specified file. I've checked over the VB
coding of the macros to see if Excel made reference to the new file that I'd
saved, but can't find it referenced anywhere in the code
Column A contains 4 digit code
Every 4 digit code has few 8 digit codes
Column B contains 8 digit Code.
For every 8-digit code there is information related to that code in columns C-N
For some codes information is stored on 2 rows and for some codes it is stored on more than 2 rows.
Is it possible to add 2 rows for every 8-digit code just before the next 8-digit code starts. These rows will contain "Import Policy Reference" from another Sheet "Sheet3"
The sample sheet can be downloaded from
http://tsi-pk.webs.com/chapter%201.xls
I have highlighted the required 2 rows i added manually in yellow
My excel is going nuts! I created some hidden macros and can see them but am not able to remove as I deleted the files!
What is the best fix? Excel is sending out notices to other employees about sharing, I can't open excel AT ALL right now!
Should I uninstall and reinstall Excel or Microsoft Suite? Will this get rid of the macros?
Thx,
I understand IE7 thinks my Excel file is a security threat and won't let this legitimate file open because the macros within suggest it is a potential threat.
-But it isn't a threat, it is simply an Excel file with macros that we need greatly and use every night.
How can I tell my computer that this file is OK. (I thought I found an option like this, but it still didn't work.)
Your help is greatly appreciated.
-Tom
|
|