If Specific Row Contains A Word Then Clear Specific Content In Corresponding Column

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...,)
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:

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.


View 6 Replies


Writing Specific Content From Excel To External File Of Specific Name

Apr 29, 2013

I have a worksheet that contains two basic columns of data, A and B. What I would like to do is based on the value in column A, I would like to copy the contents of column B to a textfile (preserving the basic line structure and hopefully without any extra characters like quotation marks attached). So for all the values in column A = 'Account', Id like to take all the corresponding values in Column E (for example) and save them to the same file, preferably where the filename itself as 'Account.xyz'. And I would like to do this for all unique values in Column A, that is do it for 'Account' and 'AccountPrivilege' etc. Note Column A is essentially presorted alphabetically already. There are actually 1000s of rows with hundreds of unique A values so Id like to find a way to automate this process.


Company Information


[Code] ........

View 2 Replies View Related

Running A Specific Maro Through The Combobox Feature When A Specific Word Is Chosen

Apr 21, 2006

I am trying to run a macro once a particular word shows up in the combo box. now in my chase i could try to use VBA code to run the macros such that once the arrow is used in the combobox to select a certain word a particular macro labled the same name as the word chosen would run.

View 5 Replies View Related

How To Find Specific Word And Sum The Column According To That Word

Mar 14, 2014

I would like to have a formula find a specific word in column L and return the sum from column E for the same fund from column C.

I tried using =SUMIF(L:L,"*annual*",E:E) but that gives me the sum of annual for the entire column. I need to be able to specify the fund.

word "annual" also appears in "semi annual" so I need to be able to separate the two.

View 5 Replies View Related

Lookup Date In Column And Finding Specific Text Value Row And Clear

May 10, 2014

I have a userform where the user will identify a record to delete. I need to search another worksheet (Month) for the event's name which is associated a date. Once it finds this event's name I need to clear the contents of that cell.

Here is the code I am using for the record deletion from the 'Data" worksheet. I need to also locate and clear the cell as stated above.

View 1 Replies View Related

Word Wrap VBA To Specific Column Width?

Jul 11, 2012

I have a database in excel, here's some sample data.

When they click the print button in Cell A2, up comes my form

When the print tags button is pressed, my secondary sheet is populated with the cell they clicked on

Now it's using a font, calibri 11, which isn't proportional but I was wondering if there's a way in VBA to "auto" detect the max width and place words on the next row accordingly (like a word wrap). Here's what I need it to look like:

Here's my existing code to place the comments as is:


entireComment = "Comments: " & Range("P" & i)
.Range("A" & cnt + 11).Value = Mid(entireComment, 1, 33)
If Len(entireComment) >= 36 Then


View 3 Replies View Related

Calculate If Specific Word Found In Column

Feb 15, 2008

I would like to use the following code to see if the word "reservoir" shows up in any of the rows in a certain column. If it does I want to insert the formula = SUM(D7:D257)*0.1 into cell C2 and if it doesn't then I want to put a 0 into cell C2. I've tried many routes but can't get past the error if it can't find the word.


View 4 Replies View Related

Color Row If Cell In Column Contains Specific Word

Apr 17, 2008

I've been trying to come up with a conditional that will format a row if a cell contains any instance of a given word.

I know the following will format rows containing the EXACT entry of "apple" in column E:

But I'd like a conditional that will find entries like "apple pie" and "crabapple" as well. I'm sure it's a simple solution, using a SEARCH function or something...but I can't figure it out.

View 3 Replies View Related

Color Row Where Cells In Column Contains Specific Word

May 26, 2008

I have a spreadsheet with 12 coloums. In the last coloum are the ords "yes", "no", or is empty (null?). I need to find a way to have each row that contains the word "no" or is empty to be highlighted in red font and bold type. When the word "yes" is typed then the font is black and the type in normal. This allows me to see at a glance what orders have not been picked up or have problems.

View 2 Replies View Related

Macro To Extract Data From Specific Column To New Sheets Specific Column?

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:



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

Delete Rows With Specific Characters In A Specific Column

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:

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
End If

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

Delete A Row If It Has A Specific Text In A Specific Column

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

Name A Range By Content Of Specific Cell

Feb 7, 2013

Column"A" on spreadsheet has list of unique Order Numbers. The orders are whole numbers with no letters or characters.

I want Columns B:J in each row to be a "named" range using the content in Col A as the range name.

So if A5 says "12345" I want b5:J5 to be named "12345".

View 7 Replies View Related

Clear Formulas In Specific Range

Jun 6, 2008

For various reasons I need to copy a the range "a2:s251" in the sheet "FWD Input" to another sheet but I need to remove any formulas.

To do this I have used the

Sheets("FWD Input").Range("A2:S251").SpecialCells(xlCellTypeFormulas).ClearContents

This works fine if there are formulas in that range, however if there aren't it gives me: " Run time error: 1004 No cells were found"

So I think I need some code that counts the number of cells in the range with formulae in them and either goes ahead if there are some or quits if there aren't.

View 3 Replies View Related

Shorten Cell's Content When Specific Conditions Are Met?

Feb 1, 2013

I have need of VBA code that will check collumn D, starting at cell 7 until cell 206, for when data that is entered starts with 100. When this occurs it will remove all of the data in that same cell except for the last 12 digits.

Here's an example.

When using our barcode scanner to capture a FedEx Tracking number the barcode captures the following:


Embedded in that long string of numbers (which are formatted as Text) is the tracking number. Specifically the last 12 numbers are the tracking number. However, FedEx varies this code at times so the last 12 numbers are the tracking number only with the raw data captured by the scanner starts with 100. Until I find additional conditions this VBA code will have to ignore all of data that is captured in collumn D starting at cell 7 until 206.

View 3 Replies View Related

Macro To Delete Specific Cell Content

Apr 24, 2009

I am having some trouble writing a macro to delete cell content. I know which cells I want to clear, but I can't seem to get the macro to do it.

I also want to have something in the macro that inserts data into the lines that I am trying to clear. I want cell A67 to say "Payment" and cell A71 to say "Total."This is the code I am using:
Sub DeleteCell()
Dim i As Integer
For i = 67 To 71
If Range("A" & i).Value = "--" Then
Range("A" & i).Delete
Next i
End Sub

View 9 Replies View Related

Macro To Clear Range In Specific Sheets

Apr 27, 2014

Looking to code a loop to go to sheets whose names begin with "day" and a number and clear a specific range. How would i code this without affecting the other sheets in the book?

View 3 Replies View Related

Macro To Clear Data In Specific Columns

Apr 19, 2013

I have set up a macro to clear data in COl A from row 2 onwards. I need to amend the code to clear the data in the following columns from row 2 as well

Col C to I and Col L to O

Sub ClearData()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LR
With Range("A" & i)

End With
Next i
End Sub

View 4 Replies View Related

Clear Array Data At Specific Indexes

Jun 11, 2014

I am using arrays to try and move select data in a row between workbooks. I read in the data to an array, I set the value of the range I want to write to to the array. That part works well.

However, the range I am trying to write to is part of an Excel Table (ListObject). There are formulas in that table that I need to keep as formulas. I know (well, believe) that if I populated the data into the array manually and skipped over the formula cells it would not change those cells at all.

How can I (after populating the entire array with data) go back and say "The data at index 3 is really nothing, so exclude it."

I've tried setting the value to Null, Empty, and vbNullString. My array is currently typed as a Variant.

myArray = Sheet1.Range("A1:A10").Value
myArray(3) = ????????
Sheet2.Range("A1:J1").Value = Application.Transpose(myArray)

View 3 Replies View Related

Clear Contents In Specific Cell And Cells In Next 2 Columns To Right?

Jul 3, 2014

I am currently using this Code to search column1 for a Key Word that is entered into textbox "Kunde" on my userform.

[Code] .....

What i would really like to be Abel to do is :

Search for the cell in column1 with =Kunde.Value

Clearcontents of this cell and the 2 adjacent to the right.

i.e. Word is found in A7

Cells A7:C7 contents are cleared and fill Color returned to default colorindex 0

View 3 Replies View Related

Code To Clear All Contents In Columns With Specific Text In Row 2

Jul 29, 2014

Below is my initial code that can't get past the first line.

if right(cells(2,i),4) = "D_MA" then ..... ?

I'm trying to clear the contents of all data in each column that has the text conaining "D_MA" in that columns row 2. For instance, if cell F2 has 30D_MA, I want the macro to clear all contents in Column "F" -- but to do this for all columns that contain "D_MA" in row 2.

View 8 Replies View Related

Clear All Pictures On Worksheet - Copy 1 Picture To A Specific Cell

Jun 10, 2014

I need to start with a worksheet without any objects, namely pictures. Without knowing the name of the object, is there a way to clear all objects on a worksheet?

Second: on a different worksheet there are products with pictures with the product number. When a user selects the product number I want to copy that picture and copy it to J42 of the first sheet. My issue is positioning the picture.

View 3 Replies View Related

Create Calendar In Excel And Auto-populate Content With Specific Fields?

Aug 23, 2013

Looking to create a calendar in excel and auto-populate the content with specific fields I enter. I know how to create an excel gantt chart but I'm really looking for a calendar view instead of a series of columns with dates. I reviewed the original post on Auto-Populating Excel Calendar but was confused by the instructions. (1) create a calendar in excel and (2) show me how to populate the calendar with fields like (dept and project name) into the dates on the calendar? I have two dates that are important (a due date for the project and when that project will be published). Is there a way to have both dates show info otherwise the most important date will be the publish date?

View 1 Replies View Related

Sum Cells That Contain Specific Word

Jan 18, 2014

I am setting up a charity accounts sheet, that will also calculate money raised from Raffles, so each raffle will have a name, I can do this by matching the amount with a description but wondered if I could calculate it by looking for specific words or reference in a cell

Sum all cells that the adjacent cell contains the reference "Raffle 0001" but not "Raffle 0002" this needs to be calculated on another cell

Sum all cells that the adjacent cell contains the reference "Rescue" this cell could contain other text as well, so could say "Rescue for Sweetie by Laura Herarty" or "Rescue for Bliss by Jane Telford" all need to be calculated.

View 4 Replies View Related

UDF If Formula That Contains Specific Word

Jan 15, 2010

I have a UDF which basically accomplishes a lookup. To do that I use this
Function name(number As String)
Select Case number
Case Is = "1"
name = "BOB"

View 9 Replies View Related

Minus Number From Cell And Result In Specific Cell And Specific Column

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

Formula To Find A Specific Word?

Aug 28, 2012

Is there a formula to find a specific word through many columns? Between A1 and L4500 i got a lot of diffrent information. I want to show if there is any cells in the row with the specific text, a formula in column M. Etc. If C100 got "topside" a notice in column M

View 5 Replies View Related

Copying Rows That Contain Specific Word

Jan 16, 2007

I am trying to copy rows that contain a specific word from one worksheet to another.

View 9 Replies View Related

Word Count In Specific Cells

Jan 2, 2007

I am trying to find a formula that will give me a word count in specific cells.

View 14 Replies View Related

Get Cell To Display A Specific Word

Oct 23, 2009

I am using the formula below to calculate the number of days left to do something, when there are no days left I want the cell to display "Begun" in red italic text. Is it possible to do that via this formula or is a macro needed? =IF(ISBLANK(E2),"",IF((E2-I2)<0,"",E2-I2-10&(" Days")))

View 3 Replies View Related

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