Delete All Those Column Contain Specific Number
Mar 6, 2010
I want to eliminate all column that contain number 3 in row A2:K2 as shown in the table below
Are highlighted in color yellow.
*ABCDEFGHIJK1123456789101121,2,31,3,91,3,131,5,131,9,111,9,133,5,73,5,93,9,114,9,135,11,13
View 9 Replies
ADVERTISEMENT
Dec 10, 2007
Currently I am using the Kickbutt VBA Find Function of Aaron, but I would like to have something that works more efficiently. What I currently do is (assuming all possible values for Column J are A - F):
Find_Range("A", Columns("J"), MatchCase:=True).EntireRow.Delete
Find_Range("B", Columns("J"), MatchCase:=True).EntireRow.Delete
Find_Range("C", Columns("J"), MatchCase:=True).EntireRow.Delete
Find_Range("D", Columns("J"), MatchCase:=True).EntireRow.Delete
Find_Range("E", Columns("J"), MatchCase:=True).EntireRow.Delete
although I just want some code that says: delete all rows except those that have "F" as content in Column J. I already tried something like:
Range("1:65536").Select
For Each cl In Range("J:J")
If cl.Text = "A" Or cl.Text = "B" Or cl.Text = "C" Or cl.Text = "D" Or cl.Text = "E" Then
Rows(cl.Row).Delete
End If
Next
but it also takes much to long. The major problem I think, is that the number of records is variable so I search the entire worksheet...
View 5 Replies
View Related
Jun 21, 2006
I need a code that will delete a row if it has a specific text in a specific column.
In this case in column W if there is anything that starts with '>TC' I need that entire row deleted that its in.
View 7 Replies
View Related
Mar 10, 2014
I would like to create a vba script when ran an input.box comes up and asks you to "enter number you want to start numbering from" and when the number is entered in the input box. e.g "7654", excel starts numbering each cell in column A from 7654 until there is an empty cell in column B.
View 7 Replies
View Related
Nov 29, 2007
I need a macro, which removes spaces, symbols, letters, numbers or combination of them from the end of all cells in a column. The symbols should be chosen before the macro starts its work.
For example:
Before running the first macro:
Column A
Word1;;
Word2;
Word3
Word4;
After running the macro the end of the cells should be cleaned from chosen symbols, spaces or signes. (in our example if a cell ends with sign ";" then these signes should be deleted).
Column A
Word1
Word2
Word3
Word4
View 10 Replies
View Related
Apr 13, 2009
I need a code that will go thru column C and delete the whole row if cell value is 78315, Also it needs to shift the the rows up so there is no empty rows wheneverything is done done. I used some codes but they take forever to go thru whole sheet.
View 4 Replies
View Related
Mar 8, 2012
Is there a VBA code I can use that will delete all rows that contain "ABC" or "YXZ" or "HHH" in column A ?
View 2 Replies
View Related
Jul 23, 2012
Macro that will delete rows in an excel table if "W2" shows up in column D. This will be multiple rows that it will need to delete.
View 7 Replies
View Related
Apr 16, 2008
I want to delete any/all rows from a worksheet (named UK) which have the word "VAN" in column P. I have tried using a 'For Each... Next statement' in a macro, but always get a debug box "Run Time Error '91' Object variable or With block variable not set". What am I doing wrong? my code follows
Sheets("UK").Select
Dim cell As Range
For Each cell In Worksheets("UK").Range("P10:P200").Cells
Cells. Find(What:="VAN", _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False).Activate
Selection.EntireRow.Delete
Next
View 3 Replies
View Related
Aug 26, 2008
I am not the best at this, but we recorded a macro and we want to delete whole rows after we 'control' find something from a specific column. WHen we recorded our macro, it finds the first instance and we hightlight the whole row and 'control' 'shift' 'end' and delete all of the rows. We did this because we sorted and made sure the information we wanted to delete was at the bottom of the worksheet. we realized that each day the spreadsheet we pull from an ip address gets bigger and the row that we started from to delete starts on a different row each day. How do we get all the information to delete everyday, even when the row that Owned starts on changes? ...
View 9 Replies
View Related
Jan 20, 2009
I have number in cell (A1) = 100. when I enter number in any cell of column(B) for example (B1)=10. then in cell (C1) the result of (A1) - (B1) = (90) and if I add in cell (B2)=10 then in cell (C1) the result of (A1) - (B1+B2) = 80 .accumulatively in cell (C1). and any number in column (B), the result will be (A1) minus any number in column(B) accumulated in (C1)
second question
I have number in cell (A1) = 100. when I enter number at cell (B1) = 10 then the result would be in the adjacent cell (C1) = (A1) - ( B1) = 90 and If I enter a new number in cell (B2) = 10 then the result would be in the adjacent cell (C2) = (A1) - (B1+B2) = 80 and If I enter a new number in cell (B3) = 10 then the result would be in the adjacent cell (C3) = (A1) - (B1+B2+B3) = 70 and so on. I want the result to be add automatically to adjacent cell in column (C)
View 3 Replies
View Related
Jun 9, 2007
I have two columns in excel. Column “A” where I have different group names column "B" all the different numbers and column “C” where I have ranked based on column “A”. I need a formula that would pick a number that is ranked 51 with specific group. Currently I’m using below formula (where MC1 represents one of the groups)that is working great unless there is no tie, however if there is a tie for rank 51 and let say two numbers are 22 and 22 the formula will return 44.
SUMPRODUCT(--(Terr!$Q$16:$Q$518=MC1),--(Terr!$AC$16:$AC$518=Main!C69+1),Terr!$Z$16:$Z$518)
View 4 Replies
View Related
Jun 29, 2008
I'm trying to count if there are situations where column a is equal to a specific number and column b is equal to another number.
both columns are numbers. Does anybody have a good idea how to do this, maybe countif, but i am not sure how to do more than one item with that.
View 9 Replies
View Related
Mar 14, 2014
I understand filtering will accomplish this but a macro would save time.
My data is in Column "B" that contains ID#. If there is a duplicate ID# in column B, delete the row, but keep one. In addition, I do not want to delete blank cells in Column "B" and non number data.
Before:
XXXXX
35069
35070
35855
35855
XXXXX
35865
35867
After:
XXXXX
35069
35070
35855
XXXXX
35865
35867
View 5 Replies
View Related
Apr 29, 2014
I am looking for a formula to return the column number of the array when a specific text is found, in this case the text is "Yes"
The Array will only ever be 5 cells beside each other in a row
for example, M4:Q4, will be as follows - No No No Yes No
I want a formula to look at these 5 cells and return the number 4 as that is where the "Yes" value is
View 5 Replies
View Related
Aug 7, 2009
I am sure this should be REALLY simple, but i just can't find the answer i'm looking for. I have a sheet which changes daily in quantity of information. I want some simple code which counts up the number of populated cells in column A and returns the answer to a cell in another worksheet - or just automatically use it to print that number of pages.
I think i should be able to do the printing side, but, currently have no idea how to count up the number of populated cells in the row. If someones feeling very generous though, giving me the code for printing that number of pages too would save me some work (the worksheet which needs printing is different to the worksheet which needs the number of cells adding up.)
View 2 Replies
View Related
Jan 11, 2009
I have the following which is in a column.
View 9 Replies
View Related
Mar 6, 2014
I have a spreadsheet that contains given answers to a multiple choice test. I want to count the number of times each possible answer has been chosen at the bottom of the column. I have tried to use COUNTIF and that works fine to give me the number times each answer has been chosen but there is just one annoying thing. If the given answer hasn't been chosed by anyone, a "0" is automatically entered into the cell. This tends to really clutter up the spreadsheet and I would prefer for the cell to be left blank if the answer hasn't been chosen by anyone.
The closest I can come up with is: {=IF(D1:D10="","",COUNTIF(D1:D10,"A"))} but unless the answer "A" is chosed in D1, the cell remains blank.
If "A" is chosed in D1, then the formula works and counts all the rest of the cells that have "A" as an answer.
View 2 Replies
View Related
Feb 13, 2013
I want to count the number of rows in a specific column up to an empty cell and assign this value to a cell. I don't want to count the total number of rows but instead I want the number of the first group of rows.
For example, column A may have cells ranging from row 2 to 10 and then from row 12 to 20, so I only want to count the first group.
The below code counts the total which is not what i need.
Code:
Sub test()
Dim Mycount As Single
Mycount = Application.Count(Range("A:A"))
Cells(1, 4) = Mycount
End Sub
View 2 Replies
View Related
Jan 5, 2009
I type random numbers into column B
I want cell E10 to read column B then display (number 26 for example) how many times number 26 appears in column B
View 9 Replies
View Related
Aug 22, 2014
I am trying to create a graph that is conditional on two different columns. The first column is a date column, the second column has various categories. I want to show how many times each category appears per month. This database is continually added to so I wanted the formula to reflect the entire column range.
For example, let say I have 5 categories (Grapes, Apples, Peach, Pear, Banana). Column A would show a date (in a M/D/Y format) and Column B would list the fruit type. I want to show how many Grapes were input in January, February, March, etc. and then move on to show how many apples in each month, and so on.
View 5 Replies
View Related
Apr 28, 2006
on one sheet we have a summary of the main list, which includes totals of money recieved, totals of all the different sources (ie, where they heard about us from), the totals of the frequencies they pay (ie, how many donate monthly, quarterly...) ... etc. on the next sheet we have the "main" list of donors, their IDs, amounts, frequency, source ...
the totals on the first sheet are updated manually, but i want to change that as there are a great number of errors.
View 8 Replies
View Related
Jun 14, 2013
I'm trying to find a way to use a macro to extract data from a specific column from Sheet1 based on the columns header/title and copied into Sheet2 into the respective column with matching header/title.
For instance, in Sheet1:
Chicken
Cow
Donkey
Pig
[Code]....
So the above table would be the result i'm aiming for.
NOTE, its not different workbooks. I'm looking for sheet to sheet macro.
I've attached a file as well if someone wants to have a go at it. There are no codes in it.
View 3 Replies
View Related
May 29, 2009
I'm trying to create a formula that takes from "Manual" Sheet the number from colume G2 and multiply it by the percentage in sheet "AllocationRule".
My formula currently is =Manual!$G$2*AllocationRule!$B5.
What needs to happen is that the total number in "Manual" needs to be distributed evenly in 4 rows by the percentages allocated in "AllocationRule".
Right now I can't copy my formula over to the sheet because the "AllocationRule" should stop at B5 and not go further and the G2 from "Manual" should not change for the percentage allocation but should change to the next row for the next month.
And then after I've done the calculation I want the LOB in "AllocationRule" to be displayed in the LOB in "H1913_H1914" but I'm not sure what formula to use.
View 7 Replies
View Related
Jan 8, 2014
I am working on a concrete pour summary, I would like to have the specific codes on each tab be affected from one summary page. So when I enter a certain number on sheet 1 , it will affect that same number section that is on a different sheet. It will be adding a certain amount to that code section every time its entered. What functions need to be used to make this work..?
View 6 Replies
View Related
Feb 12, 2009
I wrote an excel program in Excel'03 for a dental office to manage state assistance patients and one of the table columns is the state assistance number. The problem is that the program defaults to a number format when it is entered instead of a text format, which is what I want. The issue is that state assistance numbers are always 8 digits and when it defaults to a number field the program drops the required preceeding zeros.
For example the number 00123456 will sometimes show up as 123456, which is wrong. It's like sometimes it will show up right and other times it gets a butterfly in its brain and deletes those zeros irritating the receptionist here. So, how do I get the table to either stay in text format or set up a number format that keeps the preceeding zeros?
View 3 Replies
View Related
Jan 8, 2014
I am working on a concrete pour summary, I would like to have the specific codes on each tab be affected from one summary page. So when I enter a certain number on sheet 1 , it will affect that same number section that is on a different sheet. It will be adding a certain amount to that code section every time its entered. What functions need to be used to make this work..?
View 3 Replies
View Related
Jun 18, 2014
I have a row (will always be row 3) where each cell contains a day of the week, the days repeats for a year or so, making the row almost 400 cells.
Like this,
Mo - Tu - We - Th - Fr - Sa - Su - Mo - Tu - We - Th - Fr - Sa - Su - and so on...
Though, A3 doesn't have to be "Mo" because the days in this case can change (A3 can start with "Tu"), hence I think I need a macro.
So if this row contains a weekend, "Sa or "Su" I want all the cells in the column beneath that which contains a specific value to be cleared.
Example, if "Sa" or "Su" has 3 values in the columns under them, all the values that contain "X" or "Y" has to be cleared.
Like this:
Rows (1,2,3...,)
1----
2----
3 Mo - Tu - We - Th - Fr - Sa - Su - .. and so on..
4 A --- B --- X --- Y --- X --- B --- Y
5 A --- B --- X --- Y --- X --- X --- X
6 A --- B --- X --- Y - --X --- Y --- C
After the macro it should be:
1----
2----
3 Mo - Tu - We - Th - Fr - Sa - Su
4 A --- B --- X --- Y --- X --- B ---
5 A --- B --- X --- Y --- X --- ---
6 A --- B --- X --- Y - --X --- --- C
Notice the two examples in the excel file.
Excelforum.xlsx‎
View 6 Replies
View Related
Jun 3, 2014
I have attached an example. If I have a set of numbers such as the one attached, is it possible to create a formula that will show me all the combinations of numbers that add up to 55.52? In the attached I have highlighted in different colours all the number combinations that add up to 55.52. The numbers highlighted in blue appear within more then one combination. Is there a formula that can do this for me, instead of randomly adding numbers hoping they add up to 55.52.
View 1 Replies
View Related
Jun 4, 2014
I have attached an example. If I have a set of numbers such as the one attached, is it possible to create a formula that will show me all the combinations of numbers that add up to 55.52? In the attached I have highlighted in different colours all the number combinations that add up to 55.52. The numbers highlighted in blue appear within more then one combination. Is there a formula that can do this for me, instead of randomly adding numbers hoping they add up to 55.52.
examples.xlsx‎
View 1 Replies
View Related