Delete Modules From Multiple Files

Dec 6, 2006

I have several organized folders which contain contain, in total, hundreads of files all created from the same master file. The Master file contains several macros used to sort and organize data copied from our engineering database (web-based).

After a file is created the macro is no longer needed. I am looking for some direction on how to go about opening and saving the files which are located on a network drive.

I have found some good starting point here for the actual removal, and I am working on a new master file which doesn't keep the macro when saved (save as...).

View 9 Replies


ADVERTISEMENT

Delete Multiple Modules

Sep 29, 2007

I have successfully rewritten all code in one workbook project. I have cut my Standard modules from 17 to just 4 modules.

Is there a way to remove all 17 modules at once so I can replace them with the 4 new ones?

I know that right clicking on the module and then click on "Remove...." will do it, but I would have to do that 17 times.

Not too bad if this was just one workbook to do. I have about 10 other books to do the same thing to. So that would be doing the right click 170 times.

I'm not even sure if this is possible. And if it is, I was thinking at probably having the code in a workbook open event to delete the Standard Modules??? Then I could just import the new modules.

View 9 Replies View Related

Remove Modules In Multiple Open Files Results In Error If Module Doesn't Exist

Jan 30, 2008

I have a number of similar templates on a server used to produce quotations from other files with lookup formulas. They all have 2 modules, 3 & 4. Module 3 deletes certain data and shows values instead of formulas for most of the pricing etc. Module 4 contains a macro that logs info in another central workbook on the server.

If 2 files are opened based on the same template at once, when the Quote_Wrapup macro (in module3) is run on one of the open files(code follows) from a button on the spreadsheet it often produces a Run-time error '9' Subscript out of range error.

Sub Quote_Wrapup()
'To stop screen flicker
Application.ScreenUpdating = False
Range("D8:E9").ClearContents
Range("D8:F9").Interior.ColorIndex = xlNone
Range("qdata5").Font.ColorIndex = 2
Range("qdata6").Font.ColorIndex = 2
Range("A18:A1018").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Columns("A:E") = Columns("A:E").Value
Range("A980") = Range("A980").Value...................

View 8 Replies View Related

Automatically Copy Modules To Other Files

Nov 10, 2006

I need to copy a code which I have in Module 1 of File 1 to numerous other files. Is there any quick way of doing that?

View 2 Replies View Related

Delete All Modules

Apr 17, 2008

I was looking for code that actually deletes ALL modules in the VBA code after I terminate a particular program.

View 2 Replies View Related

How To Create VBA To Delete Previous VBA Modules

Jan 27, 2010

I would like to create some VBA that looks for sub's or modules and delete them.

View 9 Replies View Related

Running Multiple Modules Across Multiple Workbooks With Multiple Sheets

Feb 19, 2012

I've got data being scraped from a site, putting 1 new workbook in a folder each day

each workbook has 40 sheets in it.

i need to run 5 modules in sequence on a sheet then loop to the next sheet and run the same 5 modules.

ive writen all the modules, and can loop them through the sheets in sequence but i cant work out how to loop them through the each workbook in the folder..

is there an easy way to do this or can it not be done because it would need access to the folder that holds all the wordbooks which lives outside of excel on the desktop ?

View 5 Replies View Related

Import Multiple Text Files - Delete Rows Between Lines With File Name

Apr 10, 2014

I have around 50 text files with similar design per attached file. I need to import the text files with criteria below:-

1. include file name
2. let user choose the folder
3. exclude data from "work in process summary" to "work in process cost totals"
4. only have one title in the excel files which all text files is combined "Item, Line ....."
5. If the text files do not have title like "Item, Line, ..." do not import

Is it possible to have all criteria listed above by running a macro?

A.txt

View 1 Replies View Related

Copy And Rename Files In VBA By Searching Multiple Folders For Files?

Jan 4, 2014

how I can loop through folders to select files starting with a certain word and copy all of them to a different folder and rename them. The folder structure is given below

Company 1(parent folder)
North South East(sub folder) West(sub folder)
Jan Feb Mar.... Dec Jan Feb Mar.... Dec Jan Feb Mar.... Dec Jan Feb Mar.... Dec

In the above structure, the files are present inside each folders Jan, feb...Dec under the regions North, South East n west. note that I have to select files starting with "Sales" and copy them into a new folder(say results) and rename copied files as Sales1.xls, Sales2.xls etc. (Files are not present in the folder company1, north, south, east and east.)

View 1 Replies View Related

Save Ranges In Multiple Files To Text Files

Dec 21, 2007

I have a excel file that I enter information into. I have code that saves the files to a certain folder with the name, date, and time stamp for the file name. At the end of the day I might have 3 to 15 excel files I have created that day and I would like to take information from certain cells (examle: L3, B6, B7, B8, G8, and so on) and create a txt file with all of the information in it.

Example:
12/20/2007
Your Name
123 Somewhere St.
Here, OH 45111
Home Visit

12/20/2007
Someone Else
345 Anywhere St.
There, OH 45211
Hospital Visit

View 9 Replies View Related

Search Folder For Files Containing "Temp", Delete Files

Jun 26, 2008

Is there a code that will search a pre-determined folder for all .xls files containing the word "Temp", and deleting those files?

Example:
In the root of drive M, I have several Excel files. Anytime one of the original tracking logs is opened, a temp file of that log is automatically created. I would like to automatically search the drive and delete all files containin the word "Temp".

I've attached a picture of the directory tree, in case that will help. The file will always be named "PO Response Tracking - Temp#######.xls", with ###### representing a series of either 5 or 6 numbers.

View 14 Replies View Related

Convert Multiple Files To Text Files

Sep 26, 2007

I have about 100 Excel files in one folder that need to be saved as text files. They can keep the same name, but simply need to be converted to text files. I'd like to use VBA for this and I can't find examples that do exactly that...or ones that my limited knowledge can handle.

Excel files exist in C:Source and ALL of them should be saved as text files in C:Destination. Maybe there is an easier way, but I thought for sure there was a routine I could use.

View 4 Replies View Related

Delete Files

Jun 29, 2006

I want to search a particular folder & delete certain files. I'm using the code below.

Sub test()
With Application.FileSearch
.NewSearch
'The folder where my files are located
.LookIn = "C:Documents and SettingscDesktop"
.SearchSubFolders = False
'Search text in any type of files
.Filename = "*.htm"

View 3 Replies View Related

Delete Files Via Vba

Feb 26, 2007

I need a macro to delete all files with defined extension in defined folder.

For ex. I have a folder named "pictures" filled with pictures in jpg bmp gif etc. formats. But i need only bmp files to be deleted

View 6 Replies View Related

Delete Files In Range

Oct 19, 2009

I use some VBA that does many things and in the end it exports the files to a network drive and as a last step, it creates a Log, the log is basically one row for each file exported which includes the path and file, something like this:

Row 1: Headers...
Row 2: \networkpath odrivefolderDocument_file_name.xls
Row 3: \networkpath odrivefolderDocument_file_name2.xls
Row 4: \networkpath odrivefolderDocument_file_name3.xls

So, basically looking for a way to start at row 2 to end, and delete the files. Looking for a way to also maybe save/and archive them on my local Desktop on XP ?

View 9 Replies View Related

Delete All Files In Folder

Sep 6, 2007

I m trying to delete all files in a specific folder?

View 5 Replies View Related

Unzip Then Delete Or Overwrite Files

Aug 21, 2010

I've struggled to find the code to unzip files using VBA but I finally found it and it works (using Shell).

The problem is that I want to unzip all zip files in a folder but my zip files contain 3 files:

1 csv file that I want to keep and 1 xml and 1 txt file that I want to delete.

I can't just unzip everything and deal with the txt and xml later because the xml and txt files all have the same name. So if I don't do anything, I have a series of overwriting messages prompting me to click yes or no. So what I want is either to delete xml and txt one by one after they are created or get rid of the overwriting prompt. I've tried to put a kill or delete file just after the unzip command but it doesn't work - it's telling me that the txt file doesn't exist (should I add some sort of refreshing command ?) and I couldn't find anything on google about overwriting text or xml files.

View 5 Replies View Related

Delete Module: All Other Open Files

Apr 25, 2006

I have this piece of code which copies module1 from file1 to all other open files which I list below open.

I want to modify it so that it will delete module11 as it goes.

Dim FName As String
Dim FName1 As String
With Workbooks("CFADS01") 'copies from here
FName = .Path & "code.txt"
.VBProject.VBComponents("Module1").Export FName
End With

'copies into these workbooks
'all workbooks need to be open

Workbooks("CFADS01").VBProject.VBComponents. Import FName
Workbooks("CFADS02").VBProject.VBComponents.Import FName

View 9 Replies View Related

Delete Temporary Internet Files

Jun 6, 2008

When I run a webquery to download information from online I have found the common 1004 error to occur very often however I have found that if I delete my temporary internet files prior to running the webquery, this problem does not occur. I therefore require an automated function to delete the temporary internet files however the simple 'Kill' statement does not seem to work.

View 5 Replies View Related

Send Multiple Files Based On Criteria To Multiple Email Addresses?

Jun 29, 2014

I have a directory which contains many files, they are all names based on their locations. eg. Burwood-File1.xls,Burwood-File2.xls,Burwood-File3.xls etc

I have a master that which will contain the branch in the first column.

I have defined the directory location in a separate sheet as well as email template.

When I click on the Send Email button I want ti to attach the files that match the Branch name.

The Branch list will constantly grow.

View 2 Replies View Related

Copy Multiple Columns From Multiple Excel Files & Paste Into 1 Workbook

Nov 7, 2009

I have 8 different files all have a set of data in them

each one has a long list of (column a-n) however the number of rows change by date. I need each file copied into the finalfile.xls one after another. in the files that will be merged into the final file the final row i need copied is blank.
I have all the copy formulas and everything set, I just need a range to copy that automaticaly takes cell a10 to the first blank a cell from each file and pastes it in the finalfile.xls under the last paste so they dont over write each other.

View 9 Replies View Related

Move Files To Another Folder Delete Original

Sep 8, 2009

i would like to be able to move files from one folder to another then delete the original files.
I dont think im passsing the variables to the functions corectly.

View 8 Replies View Related

Loop Through List And Delete Files From Certain Folder

Jul 2, 2014

Say I have a list in column A

Image1.jpg
Image2.jpg
Image3.jpg
Image4.jpg
Image5.jpg

In VBA, how can I loop through the list and delete files from a certain folder. The list will vary in length from time to time.

View 9 Replies View Related

Delete Temp Files Located On FileSever Via VBA

Aug 22, 2006

Right now the security settings on my server are set so that new files can be added by anyone but only a few people can delete them. Everytime Excel opens a file on the server it creates a temp file that it cannot delete due to the security settings. This means that I have to go in to each subdirectory and manually select then delete each of these temp files.

way to identify an excel tempfile, or a method for deleting these files with VBA?

View 9 Replies View Related

Import Text Files: Delete 1st & Last Rows

Oct 25, 2006

i am importing a large number of text files from a folder into an excel worksheet (into column A) and found the following code from searching the forum.

Sub Import_Text_Files()

Const PATH = "C:Documents and SettingsSilent BazMy DocumentsElectronic Gift Card WorkTestTextFolder"

Dim My_Filenumber As Integer
Dim My_File As String
Dim My_Data As String

My_File = Trim(Dir(PATH))

If My_File = "" Then
MsgBox "No Files found matching " & PATH & My_Extension
Exit Sub
End If.......

View 9 Replies View Related

Create Multiple Files For Multiple Groups Of Data

May 9, 2008

I have one main Excel file with information (in example file - columns A & B). I want to create 4 other Excel files that will draw from the main one (in example file - columns D, F, H, & J). I want the information in Excel file A, B, C, and D to be continuous information that matches the main file. For example, the letter A matches up with numbers 1,3,4,10,11,13,15,17, and 19 in the main file. When I open Excel file A, I want a continuous list of these numbers. And I want this for all 4 Excel files which draw from the main one.

View 2 Replies View Related

Delete Multiple Columns By Column Name No Criteria Need, Just Delete Them

Jun 24, 2009

I would like a macro to find the columns named "apple" and "peach" and delete them. These would always be in row 1 but would always be in different column letters which is why I want the macro to simply find these columns by their name and not by their column letter.

And yes, I do mean the entire column altogether, shifting entire columns to the left. Wipe it off the face of the earth

View 4 Replies View Related

How To Get Multiple Cells From Multiple Files Into One Workbook

Jan 13, 2014

So, today my manager came to me and informed me that he wanted me to do a little data entry for him... WOW... So I have about 2000 invoices to go through(all excel files, in their dated folders... 12-2-2013(folder) and the filenames are 12-2-2013(1), 12-2-2013(2) etc.)

I need to take these individual files and have certain cells from each in certain cells of a new workbook for example...

file 12-2-2013(1)... I need cell C3 from that file to go to cell A2(and this will be the same for all the other files... 12-2-2013(2) cell C3 needs to be in A3 etc etc etc.. this is the sale date)
file 12-2-2013(1)... I need cell a15 and b15(they are both "stretched out" cells) to be put in C3 of the new workbook and so on.

is there an easy way/formula to do this all? I have to have this done by friday at the latest(tomorrow preferred @@) I have to input data for 7 cells...

View 1 Replies View Related

Import Multiple TXT Files To Multiple Sheet

Apr 13, 2014

I need to create a dynamic template for importing data from multiple .txt files to my workbook on a daily basis.

I recorded the macro for importing ONE txt files and starting to deveop it into looping through multiple txt files and sheets but to no avail.

1) Currently I have 4 named ranges

FileLocation = Location of my source file
FileName = All the file names of my txt files
SheetDestination = The sheet to be paste for each txt file (further explaination below)
FileFormat = .txt (for VBA purpose)

2) The macro recorded was in "ActiveSheet", thus I thought of looping through each sheet (put the activate code at the first line) for the codes to run.

3) ColA ColB
1SP.txt
2IND.txt
3US.txt
4
5
6

Column A is my SheetDestination, while Column B is the respective filename for source txt file. My final intended result would be simply macthing sheet 1 against SP, sheet 2 against IND, sheet 3 against US... so on and so forth....

View 4 Replies View Related

Excel 2010 :: Use Range Of Cells With URLs To Files And Check It They Exist - If False Delete To End?

Oct 24, 2013

This is Excel 2010 on Windows 7

Trying to figure out a VB Script but don't know where to start.

I have a sheet for each month. lets take September 2013

A Column with 200 Servers (A1:A200) on the Intranet listed as server-1/, Server-2/ Server-3 ... Server-200/
Each Server lists a location of a file for each day (31 columns per row)

I am trying to check for the existence of the files on each server (The Cells contain the URL and File Name in Range B2:AF201) starting with server-1 check the URL in B2 if it exists, go to C2, Continue with that row until the file check is False (The Page will show a 404 error) if not found delete cell url and continue. do this for all 200 rows

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved