Excel 2010 :: Deleting Rows Based On Cell Value

May 21, 2012

I'm trying to delete a range of rows based on the value of a given cell. For example, if cell AC1 shows 5000, then I'd like to delete (not just clear) the range A5000:AA1048576. Or, if cell AC1 shows 10000, then I'd like to delete range A10000:AA1048576. I've come up with what is below but I don't think this is the right way to do it. I am using Excel 2010.

Code:
Range("AC1").Select
ActiveCell.FormulaR1C1 = "=COUNT(C[-27])+2"
Calculate
Range("AC1").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A" & Range("AC1").Value:"AA1048576").Select
Selection.Delete

View 5 Replies


ADVERTISEMENT

Excel 2010 :: Delete Filtered Rows Without Deleting The Hidden Rows?

Sep 25, 2012

How do I delete filtered rows without deleting the hidden rows in excel 2010?

View 8 Replies View Related

Excel 2003 :: Deleting Or Displaying Rows Based On Cell Content One By One

Mar 20, 2014

I have a company with upto 5 products, and I have created a dropdown box where you select your product.

When I select product 1 i would need info on product 1 , when i select product 2 I need info on product 1 and 2 and continue. so for product 5 -i need info on product 1-5.

I tried to add all info on excel and tried to delete it one by one by deleting rows in excel for products but it does not work.

View 4 Replies View Related

Excel 2010 :: How To Delete Rows Based On Cell Value

Sep 23, 2011

I have a massive spreadsheet (ca.110 000 rows [excel 2010). I need to cut this monster by deleting all the cells that do not have a certain cell value within them.

Say that in my column A there are different entries (text type). I would like to delete the ones that do not match the following criteria:

"mytextascriteria*", where * somehow stands for the rest of the string.

Strictly speaking I can only determine beggining of the string I want to perserve but the values at the end of that string are changing.

I found the thread about deleting entire row based on a cell value here:
Delete entire row based on one cell?

but I couldn't quite work out how to apply it in my scenario....

Otherwise is completely pointless to do it manualy with these amout of records.

View 5 Replies View Related

Excel 2010 :: Macro - Hide Rows Based On Empty Cell

Feb 27, 2012

(Excel 2010): Hide row if cell C in this row is empty.

I've just started using macros and I'm sure there is one for this problem.

View 5 Replies View Related

Excel 2010 :: Macro To Insert Rows Based On Cell Value Using Button

Nov 10, 2013

I am on office 2010

I am new to VBA programming so i might be making a obvious mistake. I am trying to create a macro that will insert rows depending on a cell value. I also need this to be executed from a command button rather then to occur immediately after the cell value is entered. So as a example

Lets say
Cell A2 has a value 20
Cell A3 has a value 3
Cell A4 has a value 5

when this data is entered and then a Command button poressed there should be

20 rows beneath cell A2
3 rows beneath cell A3
5 rows beneath cell A4

View 9 Replies View Related

Excel 2010 :: Cell Styles Not Deleting

Apr 15, 2014

I have some cell styles that refuse to be deleted in Excel 2010. I can see them on the ribbon, but right clicking and deleting doesn't do anything. Any way I can get rid of them? Just makes things look very messy. If I click them it says "Style 'XXX' not found."

View 3 Replies View Related

Excel 2010 :: Extend Rows Based On The Number Of Rows In Another Sheet

Jun 16, 2014

calculate the number of full rows in one data base located on one sheet X to determine how many rows the macro needs to extend on sheet B (sheet B is made only of formulas for data interpretation in sheet A.

View 14 Replies View Related

Deleting Rows Based On Value Of Cell Within That Row

Nov 14, 2008

I would like to delete rows in a worksheet based on a value of a cell within that row. The worksheet will not always have the same number of rows. I will be looking at the value of each cell in column "AD", which is a date, and if it is not equal to 00/00/0000 then I want to delete that row.

View 7 Replies View Related

Deleting Rows Based On Cell

Apr 19, 2012

This is the final code needed...

Col G = Product #
Col H = Description

if Col H ( description ) has 'CVP' or "CO2" or 'CKN' = delete row

unless....

Col G is 617367, 858556, or 882949 then keep that row..

View 7 Replies View Related

Deleting Rows Based On Cell Content

Oct 17, 2007

I wish to remove the page headers that were imported along with the raw data. Here's the code I've been using.

Column_To_Check = 3
Start_Row = 1
End_Row = ActiveSheet. Cells(Start_Row, Column_To_Check).CurrentRegion.Rows.Count
MsgBox End_Row
Search_String = "."
For Row_Counter = Start_Row To End_Row
If ActiveSheet.Cells(Row_Counter, Column_To_Check).Value <> Search_String Then
ActiveSheet.Rows(Row_Counter).Delete
Row_Counter = Row_Counter - 1
End If
Next Row_Counter
End Sub

When I import the data from the text file, there are 3 dimensions separated by a period in the same field. I.E: ABC.DEF.GHI and I use the break points to seperate as such: ABC|.|DEF|.|GHI|. Therefore, all rows that contain data also contain a period in cell C, but headers don't.

The Problem

End_Row = ActiveSheet.Cells(Start_Row, Column_To_Check).CurrentRegion.Rows.Count

CurrentRegion only selects up to the first blank row. However, I need this to select the whole sheet, not just the current region.

View 9 Replies View Related

Deleting Duplicate Rows Based On Cell Values

Nov 28, 2013

I have a sheet with 45,000 rows. Let's say each row has 4 columns: Create_timestamp, Update_timestamp, email_address, and o_flag

Many rows have duplicate email addresses. I would like to remove all the duplicate rows, EXCEPT for the row with the most recent Update_timestamp.

And actually, if I could just "hide" all those rows, that would be even better, but I'd be happy just figuring out how to delete all the "old" rows, so I just have a list of unique email addresses, with their create/update timestamps and o_flag column. Seems like this is such a basic use case for "Remove Duplicates,",.

View 1 Replies View Related

Excel 2010 :: Hiding Rows Based On Dropdown

Mar 6, 2013

I am currently working on a workbook for work. It is a basic input output sheet. I have data from work that i copy and paste into sheet 1 and I have it arranged into sheet 2.

I am using windows 7 with Excel 2010, though needs to be compatible with 2007 using XP.

What I am trying to implement. I would have a drop down box in cell AD-4 with the current list

Select
Week 1
Week 2
Week 3
Week 4

What I want to implement is a code that if I select "week 1" from drop down then it will hide the entire row if data in column B = week 2, week 3, week 4, week 6

also

If week 2 is selected then hide entire row if column b = week 3 , week 4, week 5

so basically hide the weeks that are after the current selected week.

In addition to this I would also like to hide the entire row, regardless of drop down selection if data from J, K and O all = 0 or (blank).

(the first row is the current Row labels, I have a lot of current hidden columns).

A
B
J
K
O

Supervisor Name
Agent Name
Needs Complete
Completed w/o Turn in
Needs Turn In

[Code] ........

View 7 Replies View Related

Excel 2010 :: Conditional Formatting Of Table Rows Based On Value In Column?

Jan 2, 2014

I'm working in Excel 2010.

I setup a table with a column titled "Type". Each value under column "Type" defines the type of row it is: "Section", "SubSection", "SubSubSection"

I wish to create a set of conditional formatting rules that apply to data rows in this table, each rule controlling how cells within a whole row should be formatted, according to the value found in "Type", for that row.

Example:

Rule1: [@Type]="Section" -> fat red line on top of cell.
Rule2: [@Type]="SubSection" -> thin black line on top of cell.
Rule3: [@Type]="SubSubSection" -> dashed black line on top of cell.

I can't seem to make this work.

How can I leverage the nice column names, and the "@"-this row designator, within a table to create conditional formatting rules that apply to all the cells within a row, in the same way one can refer to in table formulas?

View 2 Replies View Related

Excel 2010 :: Delete Duplicate Rows Based On Values Of Cells

Jun 17, 2014

I'm new to VBA and macros, using Excel 2010, and am trying to figure out how to delete all duplicate rows in a sheet where 2 or less of their values in column A is "1". I'd like have a script that is flexible enough to change to 3 or less if need be. I also have a header row that needs to be offset in the process.

A---B-
0--123 <-delete
0--123 <-delete
0--123 <-delete
1--123 <-delete based on this the value of column A
0--123 <-delete
0--123 <-delete
1--321
1--321
1--321
1--321
1--321

or

A---B-
0--123 <-delete
0--123 <-delete
1--123 <-delete
1--123 <-delete based on this the value of column A
0--123 <-delete
0--123 <-delete
1--321
1--321
1--321
1--321
1--321

View 5 Replies View Related

Excel 2010 :: Highlighting Rows In VBA Based On Multiple Criteria And Sum Function

Apr 25, 2014

I am trying to write a macro in VBA excel 2010 that compares 2 sheets.

The macro should be something along the lines of if column 7 on sheet 1 = column 1 on sheet 2

AND

on that same row if column 6 on sheet 1 = column 3 on sheet 2

highlight green

** also on sheet1 there can be the same batch ID so if it is the same batch ID it needs to calculate the sum and look at that amount...

Sheet1:
settleid
min Tran Date
Payment Vehicle
total Deposit
total CF
total MRI
RMBATCHID

475-T
03/03/2014
Connect
$562.95
$19.95
$543.00
6G000001450835

[Code] .......

Results >

Sheet1:
settleid
min Tran Date
Payment Vehicle
total Deposit
total CF
total MRI
RMBATCHID

475-T
03/03/2014
Connect
$562.95
$19.95
$543.00
6G000001450835

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

View 9 Replies View Related

Excel 2010 :: Adding Together Separate Currency Rows Based On Adjacent Column Value?

Dec 30, 2013

I have a spread sheet which totals the amounts in 2 columns D and E, which are pounds and pence. The formulas for each one are:

Pounds

=SUM(D3:D8)+ROUNDDOWN((SUM(E3:E8)/100),0)

Pence

=MOD(SUM(E3:E8),100)

These work very well and give me the correct figures.

What I would like to do is to add up the values of each row based on the criteria of column C and have just one value in ONE cell (as shown on lines 13 & 14), so for instance:

When added together the values of rows 3,4 & 6 are 7.25 (based on a value of "W")When added together the values of rows 7 & 8 are 5.00 (based on a value of "F")

I have tried to show this as an example in the image below:

A
B
C
D
E

[Code]....

I'm using Excel 2010 on Win 7 Pro.

View 3 Replies View Related

Excel 2010 :: Combining Duplicates Then Deleting

Feb 26, 2012

I am conducting a stock count.

Column A consists of a list of the barcodes I've scanned.

In column A there is sometimes more than one of the same barcode when i have more than one of the same product. is there a way of deleting duplicate barcodes in column a and replace them with a 'Quantity' column?

View 2 Replies View Related

Excel 2010 :: Deleting Conditional Formatting On Either Close Or Open

Jul 27, 2012

I have a problem where Excel 2010 is deleting one of my conditional formatting conditions. I do not know if it is deleting it on open or close. I just know that I enter the conditional formatting, save the workbook, close the workbook, reopen the workbook, and it is gone.

The other conditional formatting conditions (simple "Cell is Blank") are left intact.

Setup:

Cell with conditional formatting is on sheet "MyRecord" at "$E$7". A corresponding boolean value on separate sheet "Data" and must be referred to by using "OFFSET" with a record locator value (workbook level named range "RecordLocator") that leads to corresponding data row, so looks like following:

Code:
=IF(OFFSET(Data!$D$5,RecordLocator,0),TRUE,FALSE)

When I configure this, it works great until I save and close the workbook. When I reopen the workbook, this particular conditional formatting is gone with all other conditional formatting left intact.

I've tried using the actual range address in place of range name "RecordLocator", changes nothing.

I can't figure out why Excel deletes this particular conditional format.

View 3 Replies View Related

Excel 2010 :: Condition To Create New Cell Value On Several Rows

Apr 5, 2014

I am working on a schedule worksheet, the days are the columns and the staff member names go down the rows. I want to create a new cell value based on a condition on each row. I have been successful working with one row but how to efficiently do the same for each row.? I'm working with Excel 2010.

View 9 Replies View Related

Excel 2010 :: Copy Data From One Cell Based On Color Of Another Cell To Different Worksheet

Jan 30, 2014

I have an Excel 2010 spreadsheet consisting of many worksheets (20 or so). Each of these worksheets contain detail level data regarding different projects. One of the columns in these worksheets is the 'Status' column (column F). There is conditional formatting on this column where if the text is 'G' then change background to a green color, 'Y'=yellow, 'R'=Red and 'U'=Grey.

The first worksheet is a summary sheet that I would like to pull information from each of the detail worksheet's columns B, D, E, G and H if the status column (Column F) is 'R' or 'Y'.

The number of rows in the detail worksheet can change each week (as few as 0 and as many as 100)

View 2 Replies View Related

Excel 2010 :: Return Range Of Cell Concatenated Based On Single Cell Value

Jul 2, 2012

I have a range of cells each containing a name. Based on a number that has to be entered manually I want excel to return the names concatenated in one cell. So for example:

Number of variable entered: 5

q9001
q9002
q9003
q9004
q9005
q9006
etc.

Should give me: "q9001 q9002 q9003 q9004 q9005"

I have been trying to work with formulas using IF and CONCAT functions. But so far I haven't figured out how to have excel return me the correct amount of variables for each separate number that can be entered seeing the number of variables entered can vary from 1 up to 50.

(Using Excel 2010)

View 7 Replies View Related

Excel 2010 :: Repeat Cell Data Based On Another Cell Column Dragging Down

Apr 24, 2014

Formula that will repeat a cell number as it drags down and as soon as the number changes. I am using helper column that shows the cell number. I need to drag this down about 1000 rows.

Excel 2010
A
B
C
1
Helper Column
Desired Result

[Code].....

View 6 Replies View Related

Excel 2010 :: Change Colour Of Cell Based On Date In Other Cell?

Jan 10, 2013

I am trying to create a sheet in XL 2010.

In Column A each cell will contain a date (differnet from other cells in that column) when inspection was last done.

Column B is when the weekly inspection is due.
Column C is when bi-weekly inspection is due.
Column D is when monthly inspection is due.
Column E is when 6 monthly inspection is due.

I need a formula to change the colour of cells B, C, D & E when each inspection is due depending on the date entered in A

I am hoping its possible that the cell colour can stay for 2 days after the due date and then return back to blank after the second day.

For example if cell A1 has a date of January 1 2013 then on January 8 2013 cell B1 turns red then on January 10 2013 the cell returns back to normal.

A1
B1
C1
D1
E1

Inspection Date
Weeekly Due
Bi-WeeklyDue
Monthly Due
6 Monthly Due

January 1 2013
Change red Jan 8 & return blank Jan 10
Change red Jan 15 & return blank Jan 17
Change red Feb 1 & return blank Feb 3
Change red June 1 & return blank June 3

Ive also attached the worksheet

View 1 Replies View Related

Excel 2010 :: Display Cell Ranges From Multiple Locations Based On 2 Cell Values?

Jun 4, 2013

I need to display a set of cells based on the value of two drop down cells i have. As I am not very good at english and worse at explinations, I'll try via screen shots...

I have two dropdowns (C4 and C6) that will indicate what table to use (Second sheet / screenshot). I want that "table" to display in the yellow box on the first page. To complicate matters, some options do not have a CLA option - those starting with X. As there are 24 different outcomes and each is 3x9 if/then statements just dont seem to cut it.

P.S. I have excel 2010 and windows 7

View 1 Replies View Related

Excel 2010 :: Formula Based On YES / No Input In Another Cell

Apr 30, 2014

Two formulas which I need in Cells E74 and E75.

Basically the formulas will depend whether the entry in D73 are Yes or No

in cell E74, IF D73 = ‘No’ then E74 = D74 + E70 ELSE IF ‘D73’ = ‘Yes’ then E74 = E70

in cell E75, IF D73 = ‘No’ then E74 = D74 + E70 ELSE IF D73 = ‘Yes’ then E74 = E70

Excel version 2010

View 4 Replies View Related

Excel 2010 :: Changing Tab Color Based On Cell Value?

Mar 6, 2014

I am using Excel 2010 and trying to change/edit the color of the tabs in my workbook to turn green or red based on a y or n placed in a cell (the same cell on each tab). I have tried variations on several themes others have asked about as well for Excel 2007 and attempted to adapt them to fit my situation but none seem to work. Here's what I was starting with:

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Range("A1").Value
Case Is < 2.5
Sheet1.Tab.Color = vbRed
Case Is > 2. 5, Is < 4
Sheet1.Tab.Color = vbGreen
End Select
End Sub

The cell I'm using is F2 and my cell value is simply y or n. I realize the example above references numeric values and greater than/less than options, but I'm not sure how to correct this for my need.

View 10 Replies View Related

Excel 2010 :: Count Formula Based On Another Cell

Aug 7, 2012

The formula I found is close but I need it to count, not sum.

=SUMIFS($C$36:$C$51,$B$36:$B$51,$B36)

Example data: [972 1] [972 2] [972 3] [214 1] [214 1] [765 1] [765 2]

I want the formula to count the different numbers in the second column based on the first column. The results should show, 972 equals 3, 214 equals 1, 765 equals 2.

I am trying to separate this out but it keeps putting this paragraph.

View 3 Replies View Related

Excel 2010 :: Enable Cell Locking Based On Value In Another Cell?

Jul 17, 2014

Is there a way in Excel (2010) to lock data from being entered into cells based on the value in another cell? Here is an example:

Row 4 contains dates from 2015-2030 as a header starting at column C (C4 and on) that represents years of revenue. Column B contains dates as well, this date can be any year but this becomes the driver for the data input in columns C through X. Column B contains the "Delivery Date"

Data is input in Columns C and so forth. The issue becomes that let's say that the date in C4 is 2016 and this is the beginning year. Obviously there should be no inputs for 2015 (C5) and the data should start to be input for this year at 2016 (C6). Often people just begin filling in the first available year not looking at what the year actually is.

Is there a way to add a formula or some logic/protection to prevent inputs in previous rows based on the values in column B? So if the value in column B is XXXX than there can be no inputs in cells less than that value?

View 6 Replies View Related

Excel 2010 :: Emailing Multiple Recipients Based Off Cell Value

Nov 21, 2011

My excel sheet keeps a list of Email addresses on column B (with duplicate email addresses), and their particulars from column C (Item price, purchase date, etc) onwards.

I need the vba to email multiple recipients (those with the "notification" field marked as yes) with their purchasing details in it. It should also prevent multiple emails to the same email address.

PS.Using Excel/Outlook 2010

View 1 Replies View Related







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