VBA To Delete Cell Content With Spisific Data
Jun 19, 2009
I need a VBA that i will attach to a button that will delete spisific data in the cell.
Eg... delete all the cell CONTENT in column A1:A65536 with the word "NONE" in them, it must only delete the word not the cell.
View 9 Replies
ADVERTISEMENT
Jan 8, 2010
I am trying to find something that will let me look at a Log Book Page (a Worksheet). I need it to look through Cells E4 trough E15 I want it to look for the 1st entry of 3 different materials.
3/4" Plywood
1/4" Plywood
3/4" Particle
These names are in a drop down menu from a different sheet in the same work book
Sheet Name link '.'!
'.'!A2 3/4" Plywood
'.'!A3 1/4" Plywood
'.'!A4 3/4" Particle..............
View 9 Replies
View Related
Mar 18, 2008
I need a macro that will search though Column AD and delete the cell contents if the cell contains "0" (zero). Edit: I'm sorry I just figured this out using the following
Dim lastrow, j As Integer
lastrow = Cells(Rows.Count, "ad").End(xlUp).Row
'I presume the last row C is not blank
For j = lastrow To 1 Step -1
'MsgBox j
If Cells(j, "ad") = 0 Or Cells(j, "ad") = "0" Then
Range(Cells(j, "ad"), Cells(j, "ad")).Clear
End If
Next
View 2 Replies
View Related
Jul 29, 2006
I got some data like this
CTM
KKB
ACD
TEEE.PK
ACFFE
OO.OB
What i want to do is to delete everything after the dot. And the dot itself
View 4 Replies
View Related
Sep 19, 2012
i have code like this to copy certain word in cell and place it at new sheet:
VB:
Sub Foo()Dim i As Long, iMatches As Long
Dim aTokens() As String: aTokens = Split("Accommodation", ",")
For Each cell In Sheets("Sheet1").Range("C:C")
[Code].....
the problem is the cell source is not deleted. what line should i change in code above to move the result to new sheet and delete row source
View 7 Replies
View Related
Oct 18, 2013
I recorded a macro:
Code:
Sub Makro4()
Range("A4:C15").Select
Selection.ClearContents
[Code] ......
This code is working home on my MacBook, but I wonder if you have any suggestions for improvement? I will assign this macro to a button.
View 3 Replies
View Related
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
May 26, 2009
This formula counts the number of spaces between words in a cell:
View 5 Replies
View Related
Sep 12, 2007
I use this to read cell content, add some text/characters (ie. [ and ]) and change the properties of the complete cell
Sub COMMENT()
Worksheets("DVD Lijssie").Activate
If ActiveCell.Value 0 Then ' Change all in to ... ... ...
ActiveCell.FormulaR1C1 = ActiveCell.Value & " " & "]" & " " & "["
With ActiveCell.Font
.Name = "Arial Narrow"
.Size = 8
.ColorIndex = 16
End With
End If
End Sub
HOW can I change this vba-code so it leave's the content of the cell like it is and add some content with the use of let's say TexBox1 and ONLY use different font properties for the newely added content?
View 9 Replies
View Related
Apr 18, 2014
Formula/macro/etc that would enable me to have content of a cell changed based on the content of another cell in the same row.
Example: cell in column D says "PSA" - so I would need the cell in column H for that same row to read "Radio"
I would need an entire sheet scanned to review for these occurrences and make the appropriate changes. I also would need the formula to be inclusive enough to scan for variations in column D cell content (PSA 1, PSA 2, etc).
View 4 Replies
View Related
Jul 7, 2014
I am currently trying to create a spreadsheet whereby if I enter certain text in a cell in Column A on worksheet 1 that correlates with text in a cell in Column A on Worksheet 2, then the description in Column B in Worksheet 2 is entered into Column B on worksheet 1.
For example, if worksheet 2 has the following:
Column A Column B
XXXX PRODUCT 1
YYYY PRODUCT 2
and I enter XXXX in column A on worksheet 1, I want Column B on worksheet 1 to automatically enter PRODUCT 1.
View 5 Replies
View Related
Dec 10, 2012
I want to use the content of a specific cell in one worksheet to be used to form the filter criteria on a set of data in another worksheet, both sheets are in the same workbook
View 1 Replies
View Related
Sep 9, 2006
I am setting up a worksheet (1) with a full list of part numbers supplied, cost etc. ie:
Part Description Price Qty
1234 Blah Blah £1.00 1
1235 Blah Blah £3.00 0
1236 Blah Blah £2.00 2
And I have set up a seperate worksheet (2) as an invoice. What I have been trying to do is when I enter a qty in worksheet (1), worksheet (2) will reconise an entry in the qty colum an copy selected fields/ cells. I can do a "=" or use an "if" statement looking at anything greater than "0". but is there a way I can get the invoice worksheet to ignore any lines with "0". So it will only copy over the information with only qtys for the invoice ?.
View 2 Replies
View Related
Mar 6, 2009
I have a file consisting of two columns, called, "bom ref" and "material"
I need to show the data as indicated in the file, headed required format required.
In effect where I have a 0, that is the material I need to show for every row with a bom ref. of 1,2 or 3, down as far as the next 0 but not including the 0, when I reach the next 0, the material is a new letter, and that letter needs to repeat down as far as the next 0, but not including the 0 and so on.
View 4 Replies
View Related
Jan 24, 2010
I have a column containing mixed text and I want to remove everything from the column except instances of certain colors; black, red, blue etc. Is there a formula which would do this or can it be done with Search/Replace?
View 9 Replies
View Related
Nov 30, 2009
I have a sheet which is running a a query against an external source, and coming back with a list of client data. Each row is an investment with it's own unique InvestmentID number and a ClientID number. Each client has their own unique ClientID, however may have multiple investments (InvestmentID) linked to their ClientID (does that make any sense?!).
Anyway, the query I have returns ALL investments. I know how to manually change this to only bring back certain client(s), however I want to be able to have the users (who don't know what a query is, yet alone to how to use/edit one) enter a ClientID into say, cell B2 and have the query reflect that ClientID. If they have to click a button to run a macro after entering the ClientID, so be it (although it'd be great if it actioned once they hit "Enter").
I know this is possible because I've used something similar before (that someone else created!). What I don't know is... if I had multiple "entry cells", could I have the query filter by two (or more?) ClientIDs? That is, they enter the first ClientID in B2 and the second ClientID in C2, the query then returns all information relating to B2 or C2
View 4 Replies
View Related
Jan 5, 2009
Can a macro be used to:
1. Delete rows that contain certain text in a worksheet ?
2. Highlight a cell a colur based on a response ?
I have attached an example of what i mean .....
In the Audit Protocol worksheet is the main information - which contains questions and answers .... If a yes, n/a or no is selected then a response is automatically generated in the observations column (thanks to SHG for helping me with the formula for this) ..... How do I then get the cell to change to red if a NO response only is selected ?
Then the information from the Audit Protocol worksheet (the observation column and number column) are copied across to the worksheet named Action List (this is done just by the copy function) .... How do I go about deleting rows that contain "no action required" - as these are not needed for the report to be generated ?
View 11 Replies
View Related
Nov 23, 2007
I have a long list that has all the services from our stores. I´m using the formula below to count how many services does each store have that are over 20 days old.
=SUMPRODUCT((G!$A$2:$A$6000=$B4)*(NOT(G!$I$2:$I$6000="Valmis/Odottaa nouto"))*(NOT(G!$I$2:$I$6000="Valmis, toimitettu"))*(NOT(G!$I$2:$I$6000="Finished/WaitingDeli"))*(Päivämääärät!$C$1-G!$C$2:$C$6000>Päivämääärät!$I$3))
Now i´m wondering is it possible to make a macro that would delete all the cells in the range that do not match the criteria of my formula?
With one exception in sheet G cell A2--> has the number of the store. There are over 40 stores so each store has a number 10, 20, 30, etc...
This is the part of the formula that determines witch store it is counting
(G!$A$2:$A$6000=$B4) B4=10 in this case and B5 would be 20 and so on... By modifying that one part i can count old services for all of our stores.
Now I want the macro to delete all services from the list that are not over 20 days old and belong to the store 10 (B4). If it would delete everything that dont match that formulas criteria i could not get a list of old services for our other stores.
What i´m trying to accomplish is get a list of the services that are over 20 days old. I´m now picking them from the list by hand and that takes a really long time. Because of the number of the stores and the size of the range.
View 9 Replies
View Related
Jan 8, 2008
Need macro or other code that will examine a column in my my table for particular text (example: find text: "Total") and then DELETE the whole row that the cell containing the text is in.
View 9 Replies
View Related
Feb 3, 2010
I have this:
Sub CompileData()
'Dim rng1 As Range
'Dim rng2 As Range
'Set rng1 = Worksheets("Sheet2").Range("A4").End(xlDown)
'Set rng2 = Worksheets("Sheet2").Range("C4").End(xlDown)
'Set AllRng = Union(Range("rng1"), Range("rng2"))
'Worksheets("Sheet1").Range("A5").End(xlDown).Delete
Now when its pasted it has cells with "Nil" in it. I need to delete them, or just not copy them over.
View 9 Replies
View Related
Apr 15, 2014
i have data from D2:D10000
I Used data of first five rows e.g ("d2:d6") if in range ("d2:d6") any cell is blank then delete the all contents of the rows
e.g
d2 have data
d3 have data
d4, d5, d6 have no data then the contents of range ("d4:d6") should delete
View 3 Replies
View Related
May 31, 2013
I would like to delete the content only of every 5th row - I do not want to delete the row.
I have about 6000 4 line addresses in one column and between each address is the number 0. Need only to delete the 0.
View 4 Replies
View Related
Jan 7, 2010
I have a worksheet in whichs Column A Cells , there is corresponding string content in Col. Z. Some cells of column Z contain of many lines (up to 100 line) which i want to reduce to one. I want to select one line through double clicking in the listbox of the userform and all other lines should be deleted and only the clicked one should remain. Code should then jump to the next non empty Z cell.
Columns B, C, D, E, F, G and H should also be shown in the userform and they should be live editable. I have attached and example file with userform and example data.
View 10 Replies
View Related
Mar 21, 2014
For a table like the one below produced for the sake of example (actual is much much bigger) I want to make it list rows that are true for a certain column for a certain variable in the matrix. So for say water terrain, which types of activity can I do i.e. swimming. Or for Offroad the activites which I can't do i.e. Run and Swim.
ActivityWaterRoadOffroad
Jog nym
Run nyn
Walk nyy
Swim ynn
y=yes
n=no
m=maybe
View 10 Replies
View Related
Oct 25, 2013
Using excel 2007. I am interested in writing a VBA code to delete rows based on the text starting content. I would like to delete rows with cells that do NOT start with an "S" or "SA"
EX:
05S0128
06S0112
05S2298
S25852
S36963
SA36185
I would only like to keep the last 3 lines.
View 3 Replies
View Related
Jan 15, 2013
I am using VBA to create a word document (.docx). This word document contains plain text content controls as well as picture content controls. I then use VBA to automatically select a picture based on the code below
Code:
Set oCC = Word.ActiveDocument.SelectContentControlsByTitle("TabPic").Item(1)
On Error GoTo TabErrorHandler
oCC.Range.InlineShapes.AddPicture Filename:="X:XFERANDREW-TDCD " & LblVL &
[Code].....
After the document has been closed down I try to open it again and I am told "The file cannot be opened because there are problems with the contents."
When I click details it says "Unspecified error" and "Location: Part: /word/document.xml, Line: 2, Column: 0"
If I click ok it says "Word found unreadable content in "". Do you want to recover the contents of this document? If you turst the source of this document, click Yes.
Clicking Yes opens the document with all the contents and it is now renamed to Document 1. If I click no it does not open.
View 9 Replies
View Related
Jan 29, 2007
how to combine the content of 2 cells into one cell and have the information separated by a comma.
For example:
CELL 1:
Software 1
CELL 2:
Spreadsheet Software
The desired results is:
CELL 3:
Software 1, Spreadsheet Software
View 3 Replies
View Related
Aug 2, 2014
I have large worksheet with data. Have data in the range L121:ED490.
I need to VB macro to check cells in column L,P,T,(every 4th column) until row 490 column ED and see if the cell is blank. If any cell in column L,P,T, and so on until column ED is blank then i need to make corresponding cell in column N,R, V and so on blank. Example : If L151 is blank then need to make N151 blank. If T152 is blank the need to make V152 blank.
View 3 Replies
View Related
Jul 27, 2007
I need a quick macro that will search column D for the words "balance forward" then delete the entire row. The macro needs to loop through many rows and it contain more than one "balance forward" reference.
View 9 Replies
View Related
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