Delete Worksheets With Specified Prefix

Nov 7, 2009

I have several excel workbooks with many worksheets (over 500 in some). Around a third of these worksheets are named "Exp1", "Exp2", "Exp3", etc.

I would like a macro that will delete all worksheets that do not have names starting with the letters "Exp". I do not want any confirmation dialogue, and as the workbooks vary in size, I would like it to finish when there are no sheets left (except the Exp ones of course).

View 3 Replies


ADVERTISEMENT

Replace One Prefix With Another Prefix

Jan 23, 2010

UDC 01_001 template black.jpgBatch 01_385 template white.jpg
UDC 01_001 template blue.jpgBatch 01_385 template blue.jpg
UDC 01_001 template grey.jpgBatch 01_385 template grey.jpg
UDC 01_001 template pink.jpgBatch 01_385 template pink.jpg
UDC 01_001 template white.jpgBatch 01_385 template black.jpg

I have 100s of urls with prefix as the left column. I need to rename them to the right column format. UDC 01_001 will take number Batch 01_385, UDC 01_002 will use Batch 01_386 and so on.

I cant figure out how to do this in one quick macro instead of replace function.

View 7 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

How To VLOOKUP With Prefix

Dec 12, 2013

G1 = will be one of these 12 choices: 01 January or 02 February or 03 March...or 12 December
K2 = Date I performed the task
D2 = Name of Inspector

I usually manually input on G2 the name of the report.

Example:
G1 = 12 December
K2 = 12/05/2013
D2 = Chris Mart

Therefore, I need to manually input on D2 = 13-12-MARTCL

Where....

MARTCL comes from a table where I have all the inspectors and their corresponding username.

That table is O2:P63. O1= Title of row (Username), P1 = Title of row (Name of inspector)

13 = year extracted from 12/05/2013
12 = Month of inspection (which can be extracted from G1 or K2)

How do I use cell reference AND VLOOKUP to create 13-12-MARTCL on G2?

View 8 Replies View Related

Add A Text Prefix

Oct 25, 2008

I have a colummn of data (text data). For my purposes I would need to add a prefix text to every single cell contained in that column; for instance, if I have a cell with a text "hellohowareyou" ,

I would need to change it by adding to it a constant prefixation text "es_ES@" so that the final result would be displayed like "es_ES@hellohowareyou" , and so on for the rest of the cells under the same column.

View 6 Replies View Related

VBA - File Prefix Only?

Jan 3, 2009

Say I have a workbook called test1.xls, where the number 1 at the end of the file name is variable. Tomorrow that character could be 2 so the file would become test2.xls etc (or could even be a letter for what it matters).

Is there a way in Visual Basic to recognize that the final character is not fixed but can get different values each time? Or in other words to recognize that the file starts with "test", and that whatever follows that prefix is not relevant?

For example....

If ActiveWorkbook.name = "'test*.xls" Then...

where * (star) could be any character.

As a Windows analogy, I am thinking of the * (star) character when one searches a certain directory for, say, Excel files (*.xls etc). Obviously, in VBE that doesn't work, and the star is just a character like any other.

View 3 Replies View Related

Trying To Use IF Statement For Prefix Only

Jul 1, 2006

I’m making a database to forklifts. Most used code I have found from this forum. I haven’t found a way how to copy existing formulas on summary sheet so that sheet name is also changed in formula. I attached also my workbook, but it’s not in English language but in Estonian. I hope that isn’t problem.

If pressed button on summary sheet (“Pealeht”) then existing blank sheet are copied and renamed. On userform1 is textbox3 which value added to summary sheet, also combobox4 value added to summary sheet. Now I want that if pressed commandButton1 on userform1 then all formulas what exist on summary sheet from F6 to CW6 are also copied to next row and in formula sheet name changed. My second question is what to write that if new sheet created then it goes always to end of existing sheets. Right now I’m using code what copies new sheet after blank sheet but it’s not satisfying me.

View 5 Replies View Related

VBA: Cannot Delete Worksheets Anymore

Jan 26, 2010

i've been programming a bit in excel and quite new to the whole thing but managing nonetheless... however, after having built a couple of macros in excel, i can now no longer delete all the worksheets listed at the bottom of the workbook.

View 9 Replies View Related

Delete Worksheets Based On Name

Feb 24, 2010

I have 50 worksheets..

I need to delete any worksheet that does not have the word ( FINAL ) in it ( minus Sheet1, and Worksheet Names ).

I am thinking of this...

Sub Delete_WS()
For Each ws In Worksheets
Select Case ws.Name
Case "Sheet1", "Worksheet names"
Case Else
''''' NEED HELP WITH CODE"""""""
End Select
Next ws

End Sub

View 9 Replies View Related

Delete Worksheets Not Named X

May 29, 2007

I need a marco which when executed must delete all other worksheets except the worksheets named "Report" and "Query" . I know the code for deleting a selected sheet but how to write this one ?

View 3 Replies View Related

Delete Worksheets With Only One Row Of Data

Feb 10, 2008

I need really is code and I'm sure it's only 4 -6 lines long. Ok, I need to do a simple task, don't ask why (as always, that's just a long needless explanation) but pretty much, all I need to do is delete each worksheet that has only one row in my workbook. All the other worksheets (for example if they have 2 or more rows) leave them as they may be and let them live.

View 4 Replies View Related

Making Sure Cell Has 'J' Prefix

Nov 23, 2008

i have a cell "h23" that must always start with a "j" or a "J"
the trouble is some of my users are only putting in the number
ie 2345 when it should be j2345 or J2345

View 3 Replies View Related

Filtering In Dropdowns With A Prefix

Feb 20, 2010

I'm not a novice but this might be something simple I didn't realize. I am creating a quoting sheet for a steel fab company. I have created dopdowns for the different materials and sizes but the dropdown is way too big. I need to have a column that helps me filter the dropdown more so I don't have to scroll through litterally hundreds of steels to find the one I need. The good news is that most steels have prefixes that make them easier to filter.

For example:

L-3x3x1/2
L-2x2-1/2x1/4

C6@8.2#
C8@11.5#

W12@16.0#
W21@44.0#

What I'm looking for is a way to have a dropdown that has all of the prefixes (L, C, MC, W, PL, etc) in it and when I select one of them the next column (the actual description of the steel as shown above) will only give me the specific steels for that steel shape (L,C,W,etc)

Currently I'm putting one row of say the MC shapes and one row of the C shapes and one row of the L shapes then copying them as needed. It's a lot of work and you can easily make a mistake.

View 12 Replies View Related

Vlookup Based On Prefix

Feb 11, 2009

I have a table like below
A B
1 x1234 value
2 y1234 value

If I want to look for all values that start with "x", is there a way to do it within a vlookup formula? Something like: vlookup("x*", A1:B2, 2, False). I know there's other ways to do this, but I want it all contained in one formula instead of splitting the A column using LEFT(A1, 1).

View 4 Replies View Related

Removing 1- Prefix In Phone #'s

Apr 9, 2009

I read the thread below on how to utilize the Subsitute function to remove periods and thought about being able to use it for this. However, I have some phone #'s in my list that contain multiple 1- scenarios in them because the area code or 3-digit prefix sometimes include a 1- also. How do I make the formula only look at the 1- for long distance and not any other 1- found in the phone #? I want to remove all of the 1- for long distance because we are trying to use a new autodialer that is pre-programmed with the 1-.

View 8 Replies View Related

Add Prefix In Specific Cell

Mar 21, 2013

VBA code to add prefix "HR" in cell H11. So no matter what I type in cell H11, for example 123456 when I hit enter I would like that in that same cell stands HR123456.

View 4 Replies View Related

Prefix Text On Entry

Jan 11, 2007

I have often used Data Validation List to create selection lists for cells in a worksheet. The problem is the list has to be on the same sheet you want to use it on. Is there any other way to do this so one common list can be used for all sheets? I have a list of accounts I want to use on 12 different Monthly tabs.

View 5 Replies View Related

Add Prefix To Selected Cells

Oct 19, 2007

for a small online database I have a column that lists nationalities:

French
Spanish
American
Latin American
(etc etc)

I need to add a prefix to all nationalities, for example:

Artist Nationality///French
Artist Nationality///Spanish
Artist Nationality///American
Artist Nationality///Latin American
(etc etc)

Is there a way I can select the 700 cells and do this in one shot? I can't add formulas because I will have to paste all this in text pad and then upload it.

View 5 Replies View Related

Prefix Cells With Text

Dec 7, 2007

I want to add "CR" to the beginning of every cell that already has data. I know I could do =a1 and it would copy all the way down. However each cell has different data and I'd like to keep it that way but add 2 letters in the beginning.

View 3 Replies View Related

Delete Middle (same) Worksheets In Many Workbooks

May 8, 2014

In the attachments is the original format of the workbook, but the sheets are blanco. Did this on purpose, because the info is sensitive.

Is there a method to delete the middle sheets, 'Total1999' and 'Klad1'?

Is there a VBA code do this in a lot of workbooks, the format of all these books are the same.

Plus I'll place them in one map if it's necessary.

View 13 Replies View Related

Delete Worksheets Not Visible In Range?

Apr 9, 2014

I have a macro solved on another post that creates worksheets based on a Range and renames the new worksheet to the corresponding value. The range is edited on a regular basis, so to keep the file size down I need to remove any worksheets that no longer have a corresponding ID in the range.

The previous post is here

HTML Code: 

Sub CreateTimeline()
Dim rng As Range
Dim rCell As Range

[Code].....

I'm sure that I could amend the above code (also removing the copy worksheet condition) to check the worksheets and delete any that no longer have no corresponding value in the range from the worksheet name.

View 4 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

Delete Duplicate Rows Vb Needs To Run On All Worksheets

Apr 20, 2009

Hi i have the below code which runs on deleting duplicate code which i found in an excel manual. I am having some trouble as i want to convert the code so that it will run on all worksheets i have which are numbered such as 1,2,3,4 etc.

This is so it makes the workbook easy maintenance for when deleting or adding worksheets which happens quite regularly.

View 7 Replies View Related

Delete Rows/columns Across All Worksheets

Jun 24, 2009

I have a single workbook with 55 worksheets. I need to delete rows #1-14, then delete columns A & B on all worksheets. The macro below seems to be running in a loop which appears to delete rows 1-14 and columns A & B until there is no more data left on the active sheet only. It does not run on any of the other sheets - even if I select all sheets before running the macro.

View 4 Replies View Related

Looping Through Worksheets: Null Value Or 0, Then Delete The Row

Jan 5, 2010

The code should go through each worksheet and if the row in column A has a null value or 0, then delete the row. The count is based off of column T. The row deletion portion of the code works, but something is wrong with my worksheet looping structure.

View 5 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

How To Delete Worksheets ( Based On A Name In Range)

Aug 20, 2008

I have a "Temp Sheet" with a range in Column A:

ColumnA
Invoice #
S9700441

it will always be at least one but could be well over 100.
I have a code that creates a new tab for each invoice #.

But now I need a code to delete them.

Is there a way to delete worksheets based on a range?

View 10 Replies View Related

Delete Only Blank Worksheets With No Data

Sep 6, 2006

I have a problem here.I have a excel work book which has more than 100 work sheets in it. First i will run a report in Business objects and then save the report as excel work book. Now here is my question.Is there any Macro which searches for blank work sheet from the 100 work sheets and delete it automatically.

View 5 Replies View Related

Merge Worksheets And Delete Duplicates

Jan 11, 2007

We receive huge Excel files and we need to validate for and delete duplicate records before they are imported to a software product called Exceed Premier. We are having a difficult time with Excel spreadsheet duplicate record validation because we have to first export the files from the Exceed database into an Excel spread, merge the thousands of other new records from multiple Excel files, then import back into Exceed.

Is there a method in Excel/VBA that can merge several worksheets and check for and delete duplicate irecords? The records will be in the 20-50K range and growing.

View 3 Replies View Related







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