Delete Range Of Cells If Cell Contains Given Value

Feb 15, 2014

I have the below given macro which does quite well at deleting the cell for a given value (Value = "_y-600_z-.jpg") in a given range. What I need for it to do is delete the cell contents if '_y-600_z-.jpg' is anywhere in the string. As an example, if the cell contains 'Handler_x-111251_y-600_z-.jpg' it will delete the cell contents.

[Code] ......

View 2 Replies


ADVERTISEMENT

Delete All Cells In Range NOT Containing Specific Value

Mar 1, 2014

Not sure if this is better suited for a macro or done via conditional formatting.

Trying to empty a standard template we use and of a certain range I need to empty all cells not containing N/A (typed not error).

View 2 Replies View Related

Delete Range Of Cells And Shift Up

Jan 30, 2013

I am trying to delete a group of four cells and have the remaining block shift up. My code is below and crashes on the red. What is the right code to get this to work?

Code:

Do
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = Range("G1").Value Then
Range(ActiveCell:ActiveCell.Resize(0, 3)).Delete Shift:=xlUp
Exit Do
End If
Loop

View 1 Replies View Related

Delete Cells If No Numbers In Same Range

Apr 29, 2008

For the description below I will be referring to the file I have attached.

I would like to write a VBA macro which will look at columns 1-4, if ALL of these are blank it will take the results from the row below in their place.

So the code column on the left will be displayed next to columns 1-4 in the row below, if columns 1-4 adjacent to the code are blank.

The 'Raw Data' columns show how the raw data will be fed into the spreadsheet.

The 'Output' columns show the desired output I would like from the raw data columns.

View 9 Replies View Related

Delete Sheets Where Sheet Name Not In Range Of Cells?

Mar 13, 2014

I am looking for some code to scan my sheet names and delete all the sheets that don't have names corresponding to the values within a cell range contained on another sheet in the workbook. For example, if any sheet name, excluding a few reserved sheets, doesn't equal one of the values contained in cells A2:A23 on sheet "XYZ" then delete it.

The best solution I could come up with using my experience was to loop through each sheet and compare the name to each cell in the named range, but if it's possible to somehow declare the named range so that each sheet only has to compare to it that would be ideal;

View 10 Replies View Related

Check If Cells Are Empty If So Delete Range?

Jul 25, 2012

im having a little trouble writing a macro to :

check if a7:t7 is empty, if so delete a6:t7 and change cell colour of a6:t7 to 'no fill'

View 2 Replies View Related

Delete All Duplicates (all Cells) In Range Specific

Apr 20, 2013

I need a code to delete all duplicates (all cells) in the range A1: F100?

Exemple:
Before
31
81
43

[Code]....

View 5 Replies View Related

How To Delete Cells In A Range Based On Date

Oct 21, 2013

I have a range (D5:BU5) that I will have various dates in each cell. At the end of the row is a percentage block. It has the formula count=(D5:BU5)/70 which gives me a percentage complete. The fun begins where some dates are based off annual, semi-annual, and quarterly. What I want to do is be able to delete cell values so they are not reflected in the final percentage. I know there is a marco that deletes the entire row but that is too much I just want a target cell.

View 3 Replies View Related

VBA Code - Delete Specific Range Of Cells?

Apr 15, 2014

I wanted to ask how to delete a specific range of data in a cell range using VBA

Here is a snipit of code I currently have:

Sname1 = Sheets("Numbers").Range("FX3").Value 'FX3 = cell F starting column letter

Range(Sname1 & Range("FR7").Value).Select 'FR7 = row number

If I added the following:

Sname2 = Sheets("Numbers").Range("FX4").Value 'FX4 = cell n ending column letter

Changed the code to the following: obviously this code is incorrect below:

Range(Sname1 & Range("FR7").Value) : Range(Sname2 & Range("FR7").Value).Select

View 3 Replies View Related

Code To Delete Whats Written In A Range Of Cells

Oct 19, 2009

I use this code to delete whats written in a Range of cells ...

View 6 Replies View Related

Delete Rows With Blank Cells In A Specific Range

Feb 23, 2010

I need a VBA to delete rows with blank cells within columns F - AZ
Columns A - E contain headers but also need to be deleted if cells in columns F -AZ are blank.

View 9 Replies View Related

Excel 2010 :: Use Range Of Cells With URLs To Files And Check It They Exist - If False Delete To End?

Oct 24, 2013

This is Excel 2010 on Windows 7

Trying to figure out a VB Script but don't know where to start.

I have a sheet for each month. lets take September 2013

A Column with 200 Servers (A1:A200) on the Intranet listed as server-1/, Server-2/ Server-3 ... Server-200/
Each Server lists a location of a file for each day (31 columns per row)

I am trying to check for the existence of the files on each server (The Cells contain the URL and File Name in Range B2:AF201) starting with server-1 check the URL in B2 if it exists, go to C2, Continue with that row until the file check is False (The Page will show a 404 error) if not found delete cell url and continue. do this for all 200 rows

View 3 Replies View Related

VBA - Delete Column If Cell Value Of Range Is Equal To Another Cell

Nov 5, 2013

I would like to create a VBA code where it will delete the entire column if the cell value is equal to value in D2

For example:

Sub Delete_Columns()
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("G2:S43"), ActiveSheet.UsedRange)

For Each cell In rng
If (cell.Value) = D2 _
Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
del.EntireColumn.Delete
End Sub

======

But I think this line is wrong but I am not sure how to fix it - If (cell.Value) = D2 _

View 5 Replies View Related

Delete A Range Based On Cell Value?

Jun 22, 2012

I would like to search my worksheet and whenever it finds the word "Description" in column "B" then it should select the range "B:E" for that row and delete the cells directly above it.

This is what I tried but nothing happens:

lr = ActiveSheet.UsedRange.Rows.Count
For Z = lr To 1 Step -1
If ("B:" & Z) = "Description" Then GoTo deleteit
GoTo xt
deleteit:
z1 = Z - 1
Range("B:" & z1, "E:" & z1).Delete
xt:
Next
End Sub

View 1 Replies View Related

VBA To Delete 4 Row Range Based On One Cell Value

Oct 21, 2013

I have a spreadsheet broken out into about 30 4-row ranges, for example (A10:L13). All of the ranges use a using a vlookup argument:

=IFERROR(VLOOKUP($A10,Fund_Range,2,FALSE),"") in the second row.

Around 15 of the ranges will be populated based on varying data in the fund_range data table, the remainder will be blank. The first row of each range is a header row, I would like the macro to delete the range when there is no value in the second row (the blank ranges). Every attempt I have made starting with other code from the forum has come up empty. I think part of my problem is the vlookup formula existing in these otherwise "blank" rows.

View 2 Replies View Related

Delete Range/Cell Names

May 25, 2008

As I have been working I have highlighted cells and typed different names in the Name Box thus creating different lists. How do I delete the lists after they have been created?

View 2 Replies View Related

Macro To Delete Row If Cell Value Appears In Specified Range

Feb 20, 2008

I am trying to create a macro that would be able to delete an entire row of data if a value in column A is equal to a range on a different sheet.

On Sheet “ISQ Raw Data”

If any value in column A (starting in row 2) is equal to a value on Sheet “Old Response IDs” Range A:A(all of column A)

Then Delete that entire row in Sheet “ISQ Raw Data”

View 9 Replies View Related

Delete Sheet Based On Cell Range

Dec 11, 2008

Let's say that I've got 125 sheets. The 1st "Reference", and the rest sheets names are "1" to "124". I need a macro to delete sheet based on cell range A1:A300. If the range contain 25 data so the number of sheet will be 26 (Reference and 1-25)

View 9 Replies View Related

Delete Rows According To Empty Cell Range

Feb 22, 2007

I am not sure of the VBA code to delete enitre row if a cell is empty only within a range, then Ascend according to that Row's Values and show the
Rank No's only on what Rows that remain.

The end result example is in Sheet2

View 9 Replies View Related

If Cell Text Equals Cell Text In A Range Of Cells Display Value From Range Of Cells

Oct 4, 2012

I have the following formula that is supposed to grab a value from C2 and check for that value in a range of cells and if it matches it is supposed to display the corresponding value in another range of cells. What am I missing??

=IF(C2='Google Doc'!$B1122:$B1266,"'Google Doc!K1122:K1266'","Not OK")

View 9 Replies View Related

Cell Deletion (delete/remove All Non Use Cells)

Oct 6, 2008

is it possible to delete/remove all non use cells
for example if i only want the cells A1 THROUGH TO O31
all the rest removed??

View 5 Replies View Related

VBA Code To Delete Cells If No Data In Cell To Right

Aug 11, 2013

One more thing and I think I completed my project. I have a tab called comments.

Column A and B will always have data in them from 1-320.
Column C may or may not have data in it from 1-320.

Is there a code I could tie a button with that will delete the cells A and B if C has no data but leave it alone if C has data?

Ex: [URL] ........

When I click sort, only A1, B1, C1 and A5, B5 and C5 will still be there and everything else deleted.

View 5 Replies View Related

Delete Cells With Difference Greater X With Cell Below

Jan 15, 2008

I would like to have a complete column compared with its immediate next values and delete the values whose difference is more dhan 5.Im new to VB programming.

D

12.90
13.34
19.90
26.90
21.55

If dis is my set of data how should i use range values?

View 2 Replies View Related

Find First Blank Cell In First Column Of Known Range / Select And Delete From That Point

Jun 6, 2014

I have multiple tables like the one in the picture and have to duplicate this code for different known ranges.

View 11 Replies View Related

Delete And Shift Cells Based On Cell Values

May 23, 2007

I have a spread sheet that has RX codes as field headers and ones or zeros as values. I want to find all cells which contain "0" and delete those cells while shifting the remaining cells left. The range of cells is aj1:dr17365 and the sheet name is "May 07 Rx HCCs"

View 8 Replies View Related

Find Matched Value In A Range For Named Cell Then Copy Range Cells Below

Aug 6, 2013

I need method, using a button, that looks at a cell--say EO2, for example--, looks back on a master worksheet at a specified row and range for a match, then looks at the information from a specified range below the matching cell (The information in this column will either be blank or have an "X" in the cell), and then those rows that do not have an "X" will be hidden in the corresponding rows in the working worksheet. Therefore, if at any time the value in "EO2" ever changes, then it will automatically find a new match and repopulate and hide information as before. About 130 columns will have its own button so that a "query" can be made that depends on the information in a particular cell in that column.

The master worksheet now has matrix of 287 rows and 58 columns. Each row is for an operating procedure and each column shows a job code. An "X" in a coordinate cell for a column/row shows whether that job code is responsible for knowing that operating procedure. So, on the working sheet, an employee's primary job code is given underneath his or her name. When the button is pushed, all the operating procedures not required for a given person will be hidden and only the required ones will remain visible--grouped, if you will. Qualification dates will be easier to see now that the information is consolidated. Whenever someone transfers to a new position, a new code will be inputed on the working sheet. When the button is pushed, a new grouping will result. Any operating instructions that overlap will still have qualification dates, so that information will not need to be transcribed.

View 9 Replies View Related

Formula To Accept / Delete Cell If Numbers In Other Cells Meet Defined Criteria

Apr 21, 2014

I am looking for a formula that either accepts the number in a cell if the numbers on two other cells are "approved". In other words, I have on cell A1 my value to be tested. On cells A2 and A3 I have two numbers. On cell A4 I'm looking for a formula that copies the number on A1 if A2 is bigger then 0.25 and A3 is smaller then 0.35. In not, there's no copy or a N/A appears.

View 3 Replies View Related

How To Match A Cell Data With A Range Of Cells And Return Cell Reference In Another Cell

Dec 12, 2012

i want to match a cell data with a range of cells and if matches return the cell reference in another cell

View 3 Replies View Related

Possible To Specify Range Of Cells And Name Range From A Cell Or Cells?

Nov 23, 2012

So instead of highlighting a range of cells and naming the range from the Name Box could you enter, for instance, $A$1:$B$25 in a cell, and name it somehow, and make this be the range?

This would be particularly useful for ranges that are continually updated.

I'd prefer to do this without VB and/or a macro, but can use it if absolutely necessary.

View 3 Replies View Related

Delete Rows If Cell Contains Date Outside Date Range

May 29, 2008

I've found similar queries on the site, but none seem to handle multiple dates, and my attempts so far have been futile!

Requirement:
I press a button on Sheet1 and am prompted to enter a start date and an end date.

Depending on the dates I enter, all rows on Sheet2 which fall outside the Start/End date range will be deleted.

All dates to be checked against on Sheet2 are in a single column, and all rows are populated, there are no blanks. Dates are in the format dd/mm/yy

View 5 Replies View Related







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