Delete Worksheets Depending On The Number Of Rows?

Jul 1, 2014

I have a workbook has many worksheets, I would like to be able to delete worksheets if, for example, the number of rows in the worksheet is less than 100 rows.

View 3 Replies


ADVERTISEMENT

Delete Columns Depending On Number Of Rows

Jun 5, 2014

I have a workbook, with a worksheet "Summary". In this worksheet "Summary" I would like to delete all columns that have less than 100 rows.

Please see the attached file : Summary.xlsx‎

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

Delete Rows Matching Cell, Across All Worksheets

Aug 20, 2006

in VBA, I would like to do the following:

Delete the entire row where any cell in that row is equal to cell "b15" in worksheet "Metal Type".
I would like it to run across all the worksheets hidden or unhidden, in the workbook, (except for worksheet "Metal Type").

If possible I would also like it to prompt the user to accept the contents of cell "b15" in worksheet "Metal Type" or enter a new string.

Also can it alert the user when "no matches were found"

View 9 Replies View Related

Combining Worksheets With Unknown Number Of Rows

Dec 16, 2009

I am trying to find a way to combine two worksheets with identical columns and an unknown number of rows. Both sheets use columns A through K.

I want to add a new sheet called "Combined orders", then copy data and headers from Sheet1, paste it to Combined orders, copy data only from Sheet2, and paste it on the row after the last row of data from Sheet1.

Sounds easy but I am easily confused by the unknown number of rows in each data set. Can someone please help?

Also, are there a few lines of code that I can copy and paste into new macros that will make the unknown rows problem easier for me in the future? (i.e., instead of just showing me the code, can you also please explain the concept behind it so I can learn for future reference?)

View 7 Replies View Related

Delete All Rows Where Cell Value Is Number

Jul 6, 2014

I have the code below which is doing all I need it to do, except I would like to add a line that deletes all rows where the cell value in column "F" is a number:

The main thing is I can delete all rows if the value in column "F" is a number.

Idea Being, it:
-Deletes all rows where value in column F is blank.
-Then Deletes all rows where value in column "F" is numeric.
-Then deleted all rows where value in column "F" is any value specified in Column A is sheet 2.

[Code] .....

View 3 Replies View Related

Delete Number Table Rows Using VBA

Jul 19, 2013

Im trying to use VBA to copy old entries from a table on one sheet, to a history table on another sheet once they have been there for two weeks.

That much has been accomplished. However, I would also like the old entries to be removed from the original table.

Each entry is numbered using the following method:

If text is entered into the second column in a row, excel takes the number of the entry before that, adds 1 and places this number in a column outside of the table. The first column of each row then references this number. This way your entry is numbered as soon as you type it in. The reason I referenced outside the table and did not type the formula in the first column directly is because when I did and excel deleted a row through visual basic it messed up the rest of the table. Referencing outside fixes that problem, but there is another.

I have several columns for conditional formatting to the right of my table, full of 1s and 0s. When a row gets deleted in the table, all remaining rows shift up but continue to conditionally format based on the cells they were originally along side of. The problem is, those cells recalculate for the row in the table that is now along side of it.

Is there any way I could make the formulas in those columns evaluate only once and to not re-evaluate once something has moved?

View 2 Replies View Related

Delete Blank Rows :: Large Number Of Row

May 18, 2009

The following macro deletes blank rows in my project (I have a source sheet that I "transfer" information to various "law practice worksheets", and it works fine. However, once I get past a certain number of rows (my project will include 65,000 rows), the macro does not delete the blank rows any more from the "law practice worksheets" (I previously sent this spreadsheet to the Forum with another question that was not answered yet). Here is the macro for deleting rows:

On Error Resume Next
Sheets("InternatlLaw").Select
Range("A2:D65000).Select
Application.DeleteBlankRows = True
Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
ActiveSheet.Range("A2:D65000").Select
On Error GoTo 0.............

View 9 Replies View Related

Find All Instances To Delete X Number Of Rows

Jul 31, 2008

I am trying to write a macro to clean up a CSV file which automatically hard codes titles throughout the spread sheet. I am getting an error on the "FindNext" method below. I am getting "Unable to get FindNext propety of the Range Class" error. Also, the code for the For loop for multiple lines does not appear to be working.

Sub cleancsv()
lastRow = Range("A1").End(xlDown).Row
pmpt = InputBox(Prompt:="What text are you looking for?", _
Title:="Text", Default:="i.e.: Finished Goods Inventory")
numrows = InputBox(Prompt:="How many rows to delete (counting original):", _
Title:="Number of Rows", Default:="i.e.: 1")
Set cell = Range("A1:A" & lastRow). Find(pmpt)
If Not cell Is Nothing Then
For l = cell.Row To cell.Row + numrows
Range("A" & l).EntireRow.delete
Next l
End If
Do

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

Delete Entire Row Depending On The Contents Of A Cell

Jan 20, 2009

I'm trying to write a procedure which will search the contents of Column B of my worksheet for the word "Total". Whenever the word "Total" is found in a cell within Column B, the entire row should be deleted.

View 5 Replies View Related

Track A Number Of Expense Items Accross 15 Worksheets With Up To 500 Rows Accross 30 + Columns Per Worksheet

Jan 12, 2010

I'm looking to use excel to track a number of expense items accross 15 worksheets with up to 500 rows accross 30 + columns per worksheet. Many of the learned people in this forum have helped me get this far, now I need some more assistance - please.

In my speadsheet I have a vlookup formula that returns a value from another worksheet. Here's an example.=IF(ISERROR(VLOOKUP($D3,Room_Configs!$A$1:$BO$3006,MATCH(M$1,Room_Configs!$1:$1,0),FALSE)),"",VLOOKUP($D3,Room_Configs!$A$1:$BO$3006,MATCH(M$1,Room_Configs!$1:$1,0),FALSE))

This works brilliantly. Now here comes the tricky part. What I'd like to do is append that formula with another one to do a vlookup on a second worksheet.

If both lookups return a value then I'd like the value of the 1st vlookup returned in the cell. If the value of the 1st vlookup is "0", then I'd like the value of the 2nd vlookup returned, and if the 1st and 2nd vlookup values are blank then a "0" is returned.

The name of the 2nd work sheet is "Non_Network_Equip"

Finally, it would be really great if the font colour for values returned from the 2nd vlookup forumla was blue.

View 9 Replies View Related

List Box Depending On Combobox And Add Or Delete Items To Range

Jul 4, 2009

i had a user form with a Combo box,list box,text box and a command button. I need the code that works upon selecting:

1)An Item from the combo box should display the list in the list box.

eg: If Country is selected from the combobox then the list box should contain all the names of the countries from the country Column

2)An item should be added to the list in the worksheet when an item is entered in the textbox.

Like wise, when an item is selected from the combobox from "Delete Items List" all the items relating to the item selected from the combobox should be displayed in the list box and a choice to delete the items relating to the combobox item should be provided.

View 4 Replies View Related

Find And Delete Depending On Answer To Msgbox Then Continue Loop

Jun 5, 2012

I am trying to build a macro that will search a column for the word "TEST" and when it finds that word it needs to prompt the user with a YesNo message box (or something similar) if they would like to delete the entire row that contains TEST. If Yes is selected, it should delete the row and continue on to find the next TEST in the column and repeat this process. If the user selects No, it should continue on to find the next TEST in the column and repeat this process.

View 4 Replies View Related

Store Row Number Within Loop And Delete All Stored Rows After Loop?

Sep 11, 2013

I have working code that returns a row number within a for loop based on parameters I set.

Each time the for loop runs I would like to store this row number, then after the loop has finished, delete all stored rows.

Code:
for rowNum = 1 to x (some variable end row number which I already have worked out using End(xlUp).Row)
if x = y then
*storedRow = rowNum
end if
next rowNum
*

Lines with a * are the bits I can't work out. I've been trying to understand arrays by reading posts on what other people have done, but I can't fit (or fully understand) the reDims, or reDim preserves into my code. I've seen what appear to be quite complex ways involving uBounds and LBounds, but unfortunately I can't see how to use them.

All I want is to simply keep adding a row numbers to a variable, (i.e. row 2, 5, 20, 33, 120, etc) and then delete those specific rows.

View 4 Replies View Related

Duplicate A Box Depending On How Many Rows Another Tab Has.

Nov 16, 2009

I need a macro to duplicate a box i have in a sheet depending on how many rows the other tab has. In this example file ive included the macro i have now. With this macro i select A1 : R23 and press ctrl shift d, it asks me how many duplicates i want and i enter the number based from how many the test2 tab has. I would like a macro to read how many rows the test2 tab has and then automatically duplicate the box that many times . In other words automate it, instead of me having to enter the number ( this number changes depending on the file i have ).

Ive included a test file with intructions and my current macro, i have 2 tabs which need to be looked at.

View 5 Replies View Related

Formula To Work Out Sum Depending On Number Of Weeks?

Jan 13, 2014

I have a spread sheet I have set up to calculate sales results, I have a column for each week in the quarter with the date at the top and a different page for each individual. I want to be able to enter a number to show how many weeks we have had and the spreadsheet to give me a cumulitive amount for the cells up to that date.

For example if I was to enter 1 in a cell A1 I would want the sum t work out just C3 for example.

If I enter 3 in A1 I would want the sum to be C3+C4+C5 wich is the three cells.

If I enter 6 in A1 it would be C3+C4+C5+C6+C7+C8 etc.

View 2 Replies View Related

Change Cell Format Depending On Number

Apr 16, 2014

I have an if statement which shows either GP% or average revenue per product. The problem is that GP% needs to be in a percentage format and revenue per product needs to be in number format. 500 is now shown as 50000% or 50% will be shown as 0.5 for example. Is there anyway on changing the format of a cell based on the number?

View 1 Replies View Related

Lookup Date In Range Depending On A Number

May 5, 2009

I have a Master workbook with 4 sheets named WEEK 1 to WEEK 4. At work we work around 13 4 week periods and need this workbook to be dated accordingly, that is Period 1 Week 1 and date of first day (Sunday) of that period. The ideal solution would be for the user to enter 1 to 13 into a cell and via a button all dates to be populated and a new workbook created for that period. I have attached a sample workbook with the 4 weekly sheets and a date range on another sheet to show the range I need the dates from. I hope the workbook explains what I need better than my explanation here!

View 2 Replies View Related

Converting A Number Into A Word Depending On Several Factors (age, *** Etc)

Nov 4, 2009

I have a spreadsheet where I want to record the VO2max value (a number indicating the maximum volume of oxygen a person can utilise) of a person.

The VO2max is just a number, normally between 30-60.

I then need excel to look up the VO2max value (i.e. “35”) and give that number a predetermined inputted value name in a different cell (i.e. “low” or “fair”, “good”, “very good” etc etc).

However, as VO2max is also affected by age and *** I also have a column for the participants age and *** and I want excel to use that to make the value name.

E.g. in a 24 year old male a VO2max of 32 is “low”
But, in a 42 year old female a VO2max of 32 would need to be classed “”moderate”

Any ideas how this can be done? can it be done?

I could post the table containing the age range, values and names if I knew how to post an excel sheet on here.

View 9 Replies View Related

How To Select Variable Row Depending On Number Introduced

Jan 24, 2013

I want to introduce a number in the textbox1, and that number sets which entire row to select for making a chart. i thought of something like this, but i cant put the variable x just like that.

Private Sub CommandButton1_Click()
Dim x As String

If TextBox1.Text <> "" Then
x = TextBox1.Text
Range("Ax:Mx").EntireRow.Select

[Code] .....

View 12 Replies View Related

How To Sort A Column Depending On Number Of Letters

Apr 15, 2008

i want to sort a column in such a way that it starts with those cells having the highest number of letter. For example:

before:

AA
AAA
A
AAAAAA
AAAA
AAAAAAAAAAA

I want it to look like:

AAAAAAAAAAA
AAAAAA
AAAA
AAA
AA
A

Ofcourse the real list doesnt contain only "A"s. It contains of words and sentences.

How can i sort columns A as mentioned? The order of column A with other columns should not be destroyed be the sorting process.

View 9 Replies View Related

Assignment Of Number Depending On Range It Falls Into

Jul 16, 2009

The number in cell M21 falls into one of the ranges from C4 to C15. A matrix number needs to be printed in each cell from N21 to N30. The selection of the number to be printed in column N (under Matrix Assignment) depends on the range it is next to in array A4:C15. For example (as shown), the correct number for cell N21 is 122 because 0.2626 falls between 0.24 - 0.2699, and Matrix 122 corresponds to that range.

View 3 Replies View Related

Insert Word Depending On Number In Cell

Jun 7, 2014

I am looking for a formula which will insert a word into cell A3 depending on the number in cell A2. For example A2 is between:

0 - 10 then insert the word Div 1
11 -17 then insert the word Div 2
18 - 23 then insert the word Div 3
24 28 then insert the word Div 4

View 4 Replies View Related

Listbox Resize Depending On The Number Of Tests

Aug 9, 2006

I have a form in which a user pastes test names into a certain column of a spreadsheet. I have a listbox (not an ActiveX control) where I want the tests to be displayed. I want to resize the listbox depending on the number of tests pasted in-depending on where the last row is in this column of test names. Is there a way to do this automatically when the user pastes a new test set in the spreadsheet?

View 2 Replies View Related

Select Multiple Rows Depending On Value Of A1?

Mar 23, 2014

I have a spreadsheet with employees and data listed. The drop-down in A1 lets someone select the employee and then it hides the rows for all other employees. I want to add the names of supervisors in the drop-down of A1 and have it select only the employees under that supervisor and hide the rest. The number of employees under each supervisor ranges from 3 to 6. This is what I have to hide the rows when selecting a single employee :

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

My workbook has stats data on the "Master" sheet(sheet #1) and analysts and supervisors on "Analysts" sheet(sheet #12). Data validation for cell A1 on "Master" sheet has all the analysts and supervisors in the first column of "Analysts" sheet with title "Select Analyst" in cell A1. I modified the "Analysts" sheet to show supervisors from B1:I1 and listed the analysts in the appropriate columns below them. Not sure how to make it select the analysts when someone selects the supervisor on "Master" sheet .

View 6 Replies View Related

Select Rows Depending On Selection

Dec 5, 2008

I have a sheet with entries dated. With values next to them.

From 1/11/08 to Whenever it ends.

I would like to work out a function to select the activerow(depending on cell)
and the 30 rows under it and then print them.

Like a report almost

This could be a button or anything, no pref on it ^^

View 5 Replies View Related

Add (every 3rd Or 4th Depending On Content) Rows Into Columns

May 21, 2012

I have a set of data all in clumn A - I want to sort into into rows - "Name", "Manage" or "Send Message", "Job title/Company" and "Country", but some are missing "Country" (therefore, some entries have 3 rows and other have 4.

The differentiator is that every name is repeated within the cell, whereas no other row is repeated. Any macro to get all these into 4 columns?

Example:

Steve Wonder Steve Wonder
Manage General Manager in ZXY games United States Jake Gave Jake Gave
Send message VP Business Development in XYH Games
Russia Carter Jonas Carter Jonas Send message in 148G
Clement Galiay Clement Galiay

View 9 Replies View Related

Sort Rows Depending On Value In Only One Of Columns

Aug 16, 2012

I wish to sort all of my rows depending on the value in only one of the columns. I do not know how to set this up, my data starts in row 7 and is in columns B:F, needs to be sorted by descending in column B.

View 1 Replies View Related







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