Macro To Delete All Worksheets Except For One Called Main

Mar 26, 2007

Does anyone out there have a macro that will delete all worksheets except for one specific one? In this case I want all worksheets deleted except for one called "MAIN".

View 9 Replies


ADVERTISEMENT

Copy To Main Worksheet From Many Worksheets

Aug 7, 2006

I went through your board and found the code below posted My Mr. Tom Urtis.
I tired it and it worked fine except that it needs another workbook.
Can it be changed to work in the same workbook to copy to a sheet named as Main from all other worksheets that I can chose?

Sub ImportDistricts()
'Instructional Message Box
MsgBox "Click OK to access the Open dialog." & vbCrLf & _
"Navigate to the folder path that contains" & vbCrLf & _
"the District workbooks you want to import." & vbCrLf & vbCrLf & _
"When you get inside that folder path," & vbCrLf & _
"use your mouse to select one workbook," & vbCrLf & _
"or use the Ctrl button with your mouse" & vbCrLf & _
"to select as many District workbooks" & vbCrLf & _
"as you want from that same folder path." & vbCrLf & vbCrLf & _ ....................

View 9 Replies View Related

Distribute Data From One Main Worksheet To Several Other Worksheets

Jan 6, 2010

I am in need of an Excel Macro to help me create an address list by market. For simplicity sake I’ll set up a mini-example: I have an Excel document with a MASTER tab that lists the Market (Column A), a person’s name (Column B) and their Phone number (Column C). What I need to macro to do is read column A and make a new tab for each market in that column, then populate the name and phone fields accordingly.

A found one macro that was close, but it does not automatically make a new tab (I have to do that manually) and it does not refresh the sheet each time I open it, so when I run the macro again I get duplicate entries.

View 13 Replies View Related

Population Worksheets With Conditions From Main Log Sheet

Sep 26, 2013

I want to be able to create a log of incoming orders and requests with a column containing initials of the person who will be responsible for handling the item entered. From this sheet, I want to populate other worksheets in the workbook with the data base on the initials placed in the first column. Each initial set would have its own dedicated sheet in the workbook.

Is it possible to create and IF "ST" in column A of main log THEN copy all data to designated fields on the ST worksheet?

View 9 Replies View Related

Split Of Main Data Based On Column Into New Worksheets?

Apr 4, 2014

spliting of main data By column criterias which start from column E1:L1 something like Pivot Table in new worksheet, but based on formula functions.Each worksheets have to based in one of this column D1:K1 headings. That also have to rapidly change with main data table.

View 9 Replies View Related

Populate Data From Multiple Worksheets Into Main Report

Aug 3, 2014

I have to create a report that captures the work of 2 different resources on each day of the month, the sheet i am working with has 3 tabs - Main (this houses the main report, with identical fields for each resource), ABC - for details pertaining to work done by the resource ABC ... and a tab called XYZ for details of work performed by XYZ. A resource can work on multiple projects and 3 different modules in one day.

So for each date, i need to bring in the details for columns .. Project Name upto the column # of FB's, for each resource that is for ABC and XYZ.

I have attached a file with sample data, it has the main tab with what it looks like before the data is pulled from the ABC and XYZ tabs ... and what it should like after the required data has been pulled from the ABC and XYZ tabs.

What i am looking for is the formula that i got to enter in the main tab in order to pull the required data from the ABC and XYZ tabs for each date mentioned in each of the columns for each resource (that is ABC and XYZ) in the main tab.

View 3 Replies View Related

Pulling Data From Multiple Worksheets To Main Worksheet?

Feb 26, 2013

I am building a workbook for small group of people in my office to use. I have 7 tabs, the first one is called Main Sheet and the other tabs are the names of each person using the excel workbook. Every tab looks the same, I have the columns labeled: date - job number - job name - contact # - comments

My desire is that each person will be able to input their data on their tab as they receive new jobs, and the main sheet will be a compilation of everyone's sheet. So to clarify, as new information is added to one tab this entire row of information will automatically be added to the next available spot on the main sheet. We are all on the same server so we can all work off the same file. Is this possible to accomplish?

View 2 Replies View Related

Update The Worksheets Field Value Based On Updates Done In Main Worksheet.

Oct 8, 2007

How to Update the Worksheets field value based on updates done in Main Worksheet.
As i have two different worksheets (Which can be even more then 5) and i want to update the Column Field value of "State" in work sheet "B" & "C" based on the updates done in "State" Column Field value in Worksheet A.
I just want to update the "State" Column Field value in Worksheet "A" and it should update the "State" Column Field value in Worksheet "B" & "C". Only the criteria to match is Number. Based on number i want to search the values in Worksheet "B" & "C" and want that these values also get updated.

View 9 Replies View Related

Detail Of Each Project - Delete Auxiliary Column In Main Sheet?

Mar 21, 2014

This file contains 2 sheet Main M and Detail D.

In Sheet Detail D, When I choose Code, month of Project, it will be shown the result.

By the way, tell me how to delete the Auxiliary column in Main sheet.

View 3 Replies View Related

Delete Worksheets Using Checkboxes Macro?

Oct 13, 2008

I've altered a Print Worksheets Macro from the web to allow me to choose which worksheets I want to delete by selecting a checkbox. For some reason, though, the macro almost always deletes the last worksheet as well as the one selected.

[Code] ......

View 3 Replies View Related

Delete Worksheets Using Checkboxes Macro

Oct 13, 2008

I've altered a Print Worksheets Macro from the web to allow me to choose which worksheets I want to delete by selecting a checkbox. For some reason, though, the macro almost always deletes the last worksheet as well as the one selected.

View 2 Replies View Related

Macro To Delete Hidden Worksheets

Jul 11, 2008

It would be great of I could delete all but one of the hidden worksheets. It would be perfect if I could tell the macro not to delete one of the hidden worksheets (called "Test O2 and CO2"), but if that is too difficult, then just one to delete all the hidden sheets would be fine.

View 9 Replies View Related

Macro That Will Delete Duplicates On Entire Worksheets

Dec 29, 2011

I have a macro that delete empty cells in a column, what i wanted to do is while deleting the empty cells is that the macro will also delete duplicates in ENTIRE WORKSHEETS. My file has so many sheets so i need a macro that run or loop on my entire worksheets.

This is my code. that only runs in a single sheet.

Code:

Sub deleteblanks()
Columns("H").SpecialCells(xlBlanks).Delete (xlUp)
End Sub

[Code] ..............

View 9 Replies View Related

Macro Button - Insert / Delete Across Multiple Worksheets?

Mar 19, 2014

I'm trying to track information pertaining to employees across different worksheets in one excel file. I have one sheet that is the master list of employees. The first column of every worksheet is the same (employees names based on their location) but track different information.

I want to be able to create a macro button that will update all the worksheets if i insert or delete an employee from the master list. When a new row is inserted, the other worksheets should be updated as well with the new name and a blank row to be filled in. And when a name is deleted, the entire row should be deleted as well.

View 2 Replies View Related

Macro To Find Named Worksheets In Workbook And Delete?

Nov 27, 2012

I need macro to find worksheets (tabs) starting with word 'sample' in name and delete all instances of worksheets starting with that word.

View 1 Replies View Related

Macro Paste Special, Protect, Delete Worksheets

Jul 19, 2007

I am looking for a macro that can do one of two things. I am not sure which way I want to go with this yet and how automated it should be. Either scenario will result in a significant time save.

Scenario One
1. Copy & Paste Special Values on the selected/active worksheet
2. Protect Selected Worksheet with password "1234"
3. Delete ALL worksheets except the selected/active worksheet from the file. Names of other sheets can be various and are not static

For example:
A workbook has the following: sheets1, sheet2, sheet3, sheet_unknown_name
If you are working in sheet1 the macro would copy paste special values the entire sheet, protect sheet1 with the password "1234" and delete any and all other sheets.

Scenario Two
1. Copy & Paste Special Values on the selected/active worksheet into a new workbook
2. Protect the new workbook with password "1234"
3. Rename the new workbook with the original workbook name adding either "em_" to the front or "_em" to the end of the filename
4. File, Send To, Mail Recipient as attachment.

View 4 Replies View Related

Macro Called For Copying

Feb 23, 2007

I have a macro called "Copying" and this runs perfectly well when run on its' own.

I have now created the following peice of
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Sheets("form").Range("B14").Value x Then
x = Sheets("form").Range("B14").Value
End If
Application.Run "Copying"


End Sub
Which (should) run the "Copying" macro if cell B14 is changed........here is my problem.

It seems to run this macro over and over again. How can I get it to just run it once?

View 9 Replies View Related

"PC" To Show Up If I Type A Sentence Containing "Called Parent", "Called Dad", Or "Called Mon"

Dec 2, 2009

I need "PC" to show up if I type a sentence containing "Called Parent", "Called Dad", or "Called Mon". Here is what I'm trying.

View 2 Replies View Related

Skip Lines If Macro Is Called From Another Macro?

Feb 13, 2014

I am calling sub B from sub A and want to skip some lines in sub B (only when it is called from sub A).

View 3 Replies View Related

Suppress Message When Macro Called By Another Macro

Aug 15, 2007

I have a Macro (AutomateReport) that, among other things, calls and runs a macro (ReportStep1) in another workbook.

ReportStep1 includes three prompts asking the user to press "OK" to confirm that the data included is correct. When I call ReportStep1 as part of my larger macro I would like to suppress these prompts or automatically respond "OK" so that I don't have to be bothered with them.

SendKeys works sometimes, but I am hoping for a more reliable method.

View 3 Replies View Related

To Create A Function Macro Called FSTD

Nov 5, 2008

i need to create a function macro Called FSTD that inserts words into a cell and conditionally formats them depending on th number in the cell on the left.

in the sheet there are ranges that the number will fall between.

Example

Cell B1 is the cell were i want to run the function in
Cell A1 is the cell with the number that is used in the function

Cells A3:A7 are that ranges that i need to use in the function

E.g. if the number in A1 is less than A6 = i want "P" to appear in the cell with a red backround

if the number is greater than A6 but less than A5 = i want "M" to apear with an orange back round

if the number is Greater than A5 but less than A4 = i want "E" to apear with a green backround

even if it is possible to do without changing the backrounds, just to insert the letters

View 9 Replies View Related

Macro- List Of CSV Files In A Folder Called Balances

Dec 18, 2008

creating a macro, I have a list of CSV files in a folder called balances, i need a macro that will look into each CSV file and grab all p'folios which have a negative balance in Col D and line them up as per example shown below. The extracted data needs to be copied to file named "Workings" S:RecsalancesWorkings

All data in CSV file looks like this, where header row is row 1 starting at A1

CSV data

CSV filenames all start with ddmm so e.g. 0111

End DatePfolioA/c CodeA/c Native at End1/11/20081GRVMAAUDCUST 1/11/2008AFSBGEAUDCUST 1/11/2008AFSMBEAUDCUST 1/11/2008AFSPEEAUDCUST 1/11/2008AFSTRNAUDCUST 1/11/2008AMPFSVAUDCUST 16,565,587.811/11/2008GIORIQAUDCUST 155,642.251/11/2008GIORISAUDCUST 1/11/2008PINESIAUDCUST 5,654,632.861/11/2008WACCGIAUDCUST 7,457.561/11/2008WCTARIAUDCUST -3,923.721/11/2008WCTARWAUDCUST 1/11/2008WCTASIAUDCUST -73,456.201/11/2008WCTBGFAUDCUST 1,662.651/11/2008WCTDAIAUDCUST 1/11/2008WCTFUNAUDCUST 27,665,698.291/11/2008WCTGMIAUDCUST 31.251/11/2008WCTROWAUDCUST 6.961/11/2008WCTTHSAUDCUST 22,030.01

Macro to line up data as per below

P'folioDateWCTARIWCTASIWSTFDGWTDTADWTFFI3WTGTFAWTRLGD1/11/2008-3,923.72-73,456.20-4.18-136,496.19-562,967.29-2,319.40-15.762/11/2008-3,923.72-73,456.20-4.18-136,496.19-562,967.29

View 9 Replies View Related

Excel 3003 :: How To Prevent To Stop Macro Called From A Function

May 3, 2014

I am trying to use the simplest code possible (being a novice) to execute a macro which makes a copy of Cell A1:A4 and paste its values to Cells B1:B4 if cell B5=1 (or whatever). The Macro with copy and paste works (I recorded it and in my testing it was ok). And also the function, that contains If-Then status of cell B5, works and calls correctly the Macro.

Yet when the macro is called by the function (=CopyMyCells(B5)), the Macro (MacroCopy) runs - I tested this with a Msgbox - but stops just in doing what I need, i.e. in doing the copy-paste process. Here the code which is placed in a module of the proper Worksheet (Excel 2003, on WinXPSp3):

[Code] ........

View 6 Replies View Related

Run Time Error 1004 (macro Called From Access Module)

Nov 19, 2008

i am running a macro thru vba (beiing called from a ms access module) and am getting a RuntTimeError 1004.

the code opens a workbook...then open a second workbook (which houses the macro) then activates the desired worksheet and call the Maco via the run command but errors out.

if i open the workbook and set focus on the desired sheet ....tool>macro>desired macro name it runs fine.

the line of code in the macro is: "ActiveCell.Offset(1, 0).Activate"

View 9 Replies View Related

Delete Any Sheet After Sheet Called (Summary)

Jun 29, 2014

i want to delete any sheet after sheet called "Summary"

View 1 Replies View Related

Macro That Cycles Through Sub Folders Within A Main Fold

Sep 15, 2008

i am looking to create a macro that cycles through sub folders within a main fold and takes the same line of nformation from each workbook that it cintains.

the main folder is a yearly folder "2008" there a 12 subfolders within this named "january" to "December" (one for each of the months of the year) Within the monthly folder are four weekly forlders named "week 1" to "week 4"

each of the line in the workbook ferer to a different person so i will need to transfer all of them into individual summary workbooks. but in this example i need to take the information from A3 - K3 from each workbook.

View 9 Replies View Related

Loop Through Worksheets Not Working (delete Some Hyperlinks In Column A On 50+ Worksheets)

Jan 16, 2009

Just need to delete some hyperlinks in column A on 50+ worksheets. Thought a loop through all the worksheets would do it. Only works on active sheet. Forgive my ignorance, don't really even know where it goes, once it works - module or workbook?

View 2 Replies View Related

Excel 2007 :: Create A Main Macro To Control Other Macros Within A Workbook?

Nov 7, 2012

"How to create a 'main' macro to control other macros within a workbook". I have my individual macros created. There's one macro for each sheet that searches online data and returns the information. I have one of these per sheet (a total of 20 sheets) since I couldn't find a way to have all 20 macros be on one sheet and still work. My trouble is that whenever I'm on my 'main' sheet and try to run the macro which applies to a 'secondary' sheet, I get an error. I have to select the sheet first, then run the macro and it works. Below is the macro on each sheet.

VB:
Sub Holding1()
Dim DataSheet As Worksheet
Dim EndDate As Date [code].....

View 8 Replies View Related

Run A Macro Called "PriceForm" Instead Of Clearing The Cells

May 30, 2009

Code to run a macro called "PriceForm" instead of clearing the cells.

Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("T5:X50").Value = ""
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub

View 9 Replies View Related

Macro To Pull Data From Multiple Sheet To Main Sheet Based On Column Headings

Sep 13, 2012

I need a Macro which pulls the data from different sheets of excel (which is not formatted properly) to Main Sheet. Also some of the columns will not have the same names, so macro should handle this exception as well.

View 8 Replies View Related







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