Find Matching Value In A Range On Different Sheet And Delete
Jan 18, 2014
I am an inventory specialist for a dish network company and as such I track inventory in and out of technicians vans, both serialized and not. I've done a great deal of work updating a broken excel sheet they use so that it functions again but I didn't build it. I've learned a lot but I'm only self taught with Excel and had never even heard of VBA code until I dived into this project.
Anyway, basically I have one sheet that has a list of all the items I need to keep track of. One section of this Sheet1 I've designed to have cells with dependent drop down lists that are Named Ranges on Sheet2. The tech can choose item A B or C in the first dropdown box and then the next cell shows only the serial numbers from the named range on Sheet2 of A B or C. (Was that english?)
Since the receiver comes out of the techs van once its used I want to figure out a way to delete the serial number that the tech has chosen without deleting the row or cell, just the value in it so that it can then have another serial number typed in. How can I do that?
Also, since I'm here, my 2nd drop down list seems to always start scrolled down and I have to scroll up to see my serial numbers. Why is that? The receiver list starts at the top but the dependent one doesn't...
View 4 Replies
ADVERTISEMENT
Jan 28, 2014
I am an inventory specialist for a dish network company and as such I track inventory in and out of technicians vans, both serialized and not. I've done a great deal of work updating a broken excel sheet they use so that it functions again but I didn't build it. I've learned a lot but I'm only self taught with Excel and had never even heard of VBA code until I dived into this project. It's a huge puzzle and is now my "baby".
Anyway, basically I have one sheet that has a list of all the items I need to keep track of. One section of this Sheet1 I've designed to have cells with dependent drop down lists that are Named Ranges on Sheet2. The tech can choose item A B or C in the first dropdown box and then the next cell shows only the serial numbers from the named range on Sheet2 of A B or C. (Was that english?)
Since the receiver comes out of the techs van once its used I want to figure out a way to delete the serial number that the tech has chosen without deleting the row or cell, just the value in it so that it can then have another serial number typed in. How can I do that?
Also, since I'm here, my 2nd drop down list seems to always start scrolled down and I have to scroll up to see my serial numbers. Why is that? The receiver list starts at the top but the dependent one doesn't...
View 2 Replies
View Related
Dec 28, 2013
I'm looking for code to find a copy of the text in cell AH3 in a range AH7:AH100 then delete all copies of the text in that range AH7:AH100 leaving other cells in that range which contain different text intact.
View 3 Replies
View Related
Feb 27, 2012
Macro: Copy selected cell to another sheet next blank row
I'll just make this simple to understand.
*Again, I have first sheet, named "SUMMARY"
*On Column A, I have list of names
A1: Star
A2: Moon
A3: Sun
A4: Clouds
*these cells corresponds to the Cells of different sheets
A1: Star = E3 of Sheet 1
A2: Moon = E3 of Sheet 2
A3: Sun = E3 of Sheet 3
A4: Clouds = E3 of Sheet 4
this is what I should get:
1. I select the cell A1 as an active cell
2. press the button (with the macro on it)
3. I will automatically go to the sheet where "Star" is located
View 2 Replies
View Related
Apr 19, 2014
I have a Meeting Place and Cities Table(too large).An example attached as a file and explained waht is wanted.
View 2 Replies
View Related
Feb 19, 2009
In a row on the spreadsheet I have a range of dates from 19/09/2008 to 19/06/2008 mainly with a weekly interval.
I want to incorporate into the macro a find function so that it can determine the first occurrence of a specific month and return the row number.
View 9 Replies
View Related
Oct 18, 2013
I have a client list in a table in my excel sheet. I currently enter the clients in a sheet that looks similar to a form. After the clients info is in this Form I have a button with a macro to copy the client info into a table on another sheet. This works perfectly.
Now I have another form that will retrieve the customers info in a click of a button in order to make changes to the client. Ei:I now have a second phone number and I want to update that client's info. What I want to do from here is take the info in Cell B2 (clients full Name), Do a vLookup in the "Saved Clients Table" in a Range within my table range. (Range: Saved Clients and the client's full name is in $A:$A and called "Clients Full Name" and once that name is found I need to select the cell in column C and the corresponding row.
This will allow me to copy the info in my form, Paste it in Transpose to the cell that is selected. (I already have that code)
Here are screenshots of what I am trying to accomplish. [URL] .......
View 3 Replies
View Related
Nov 12, 2009
I'm trying to find a way to search a second sheet in a workbook for specific criteria outlined in a first sheet (in my attached example, from A3 downwards within the 'list of search criteria' sheet), and then to copy any secondary data found against a successful search match to the original sheet, transposed against its corresponding matched search term.
As you can see in the example, the search term 'bindi' (A4 in the 'list of search criteria' sheet) appears in the 'data' sheet 3 times - the secondary data for these occurences ('feathery', 'Fibonacci', 'glassy') is copied to the 'bindi' row on the first sheet and is offset with each copy to produce a transposed-esque effect of copy and paste.
If it's any help, there are a maximum of 9 matches for a single search term in the real document.
Thanks in advance for your help... I tried to adapt a previous solution given to me for a similar question but failed miserably. I bow humbly to your expertise!
View 9 Replies
View Related
Jun 1, 2008
i'm trying to create a macro to find any value <> "" from COLUMN B then copy Bx;Cx;Dx and paste into another worksheet with the name of COLUMN A.
And when the cells Cx or Dx is empty should appear 0 into the other worksheet
for example.
sheet1 ..... cell("dx") is empty
a b c d
w 5 3
the macro would copy 5,3,0 and paste into sheet named "w".
i found this code on internet but it's not quite good for me because it copies the hole row. i tried everything to change that but i couldn't.
[url]
(ORIGINAL CODE)
Sub SearchForString()
Dim LSearchRow As Integer
Dim LCopyToRow As Integer
View 9 Replies
View Related
Aug 6, 2008
I am trying to select all the data in every row below where the first "flat" entry in the worksheet is but it will only go to the bottom of the data in the column where it finds flat. Some data in other columns extends beyond this so it is not working for me. It would work for me to select everything from where it finds flat to the very last row 65536 but I can't figure out how to do that with what I have. I am then deleting all this data.
Cells.Find(What:="flat", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.EntireRow.Select
range(Selection, Selection.End(xlDown)).Select
range(Selection, Selection.End(xlDown)).Select
range(Selection, Selection.End(xlDown)).Select
View 3 Replies
View Related
Sep 12, 2008
1) Highlight column A, and do a search on the word "Item"
2) Once it finds the word item, move 2 rows above it, and delete all rows above the word "Item"
The word Item at times can be on any row, and its very random, but its always in column, A. I tried doing it with a regular macro, but it seems to remember the row that I used, rather than two rows above the word "Item".
View 9 Replies
View Related
Aug 4, 2009
I have a workbook that has 1800 sheets, some have a grey (VBA colour 15)filled cell somewhere in column A (varying no.s of rows) that I want to keep. Some have no filled cells at all in column A and I want to delete the sheet.
View 9 Replies
View Related
Jun 11, 2008
I'm building a course registration workbook and am working on the unregistration macro.
I have a seperate worksheet for each course, labelled by the course code.
There is also a page for each registered participant that shows what courses they're in.
The macro reads off the information on the participants page, and then should goto each registered course's page, look in column C for their name, find it, delete the contents of that row for Columns C to G (has their other information) and then shift all CELLS (not rows) below the now deleted cells up 1 to keep track of the order they were added.
I've tried recording my own macro and editing... but it doesn't work very well for this.
I've also tried searching and come up with nothing, but if someone can look at my code, and/or point me in the right direction, it would be greatly appreciated.
For Each ws In Worksheets
'checks only course sheets that match the courses the individual is registered in.
If ws.Name = unregisterCourse1 Or ws.Name = unregisterCourse2 Or ws.Name = unregisterCourse3 Or ws.Name = unregisterCourse4 Or ws.Name = unregisterCourse5 Then
'Should search for the variable "unRegister" in column C and select it.
Cells.Find(What:=unRegister, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
'Now needs to select the four cells to the right as well (C:G) and delete them
'Select all cells below from C:G and shift them up one.
End If
Next
View 5 Replies
View Related
Apr 21, 2009
See attached doc "Find and Delete.xlsx". Inside, the value in F12 is a very important cell. Using the text value from F12, I first want to use visual basic code to find the range in column B because it will vary. This means the 'text words' column might have 50 words or it might have 2000. I have racked my brain trying to find a universal way to find a variable range.
Then I would like to search for the exact text value within this range in column
B. For example, in F12 is the text word 'windows xp registry cleaner' and you can see that this value is in B9. There will only be one exact match in column B.
I then would like the vb script to delete and remove this found value, then move left one space in column A to also delete the ID number associated with the text word. Then shift both rows up to fill the empty gap. I have tried numerous different codes but to be honest, I'm not really sure what I'm looking for. I've tinkered with find and replace, vlookup, match, find, search, and many more.
View 2 Replies
View Related
Jun 2, 2014
I want to do is add data into Sheet A each day then press a button which will copy the data in a range and paste it into Sheet B, but I want to create a list of all data so I need it to find the next empty cell and start the paste from there (if that makes sense).
I want it to create a data base on one sheet from a daily import, I have a code to copy one cell to next empty cell but dont know how to duplicate it to a range.
I hope I have given you enough info this is what I have done so far
Public Sub CopyData()
Dim ws As Worksheet, bi As Byte, vData(1 To 1)
Set ws = Sheets("A")
For bi = 1 To 1
vData(bi) = Application.Choose(bi, ws.Range("A1"))
[Code]....
View 7 Replies
View Related
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
Feb 26, 2012
how to write a module that will if check if
if cell A5 has text in it,
check range (b5:t5) for any empty cells or any cells with the word "sp" in it,if there are any empty cell or cells with "sp" delete this sheet.
then check
if cell A8 has text in it,
check range (b8:t8) for any empty cells or any cells with the word "sp" in it,
if there are any empty cell or cells with "sp" delete this sheet.
View 3 Replies
View Related
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
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
Dec 19, 2006
I am looking for a way to delete all the range names in a worksheet, not the whole workbook. I have found several procedures that will delete all the names in an activeworkbook. For some reason it takes too long to run. Does anyone know how to handle a single sheet in VBA?
View 6 Replies
View Related
Nov 17, 2011
How can i find if a named range exists in a sheet using VBA?
E.g.: I have a named range called test that houses 4 numbers in four cells. Using
Code:
Dim rtest As Range
Set rtest = Worksheets("sheet1").Range("test")
.
.
.
.
rFoundCell = _
Cells.Find(What:=rtest, After:=Range("a1"), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:= _
xlByRows, SearchDirection:=xlNext, MatchCase:=False)
Won't work. Run - time error 91 occurs.
View 9 Replies
View Related
Jun 17, 2009
Situation: I would like to compare the information between two worksheets and delete the rows that contain the same data in multiple columns, on a row by row comparison.
IE: I have two worksheets, each have identical row headers, with 5 columns each.
Company Load Date Load Time Load Description Amount ?Report?
Store#44 5/14/2009 11:55:41 AM MMBAYO $40.00 WS1
Store#44 5/14/2009 02:34:21 AM SLATOUR $20.00 WS1
Store#45 5/14/2009 01:55:41 AM GCHANDLER $100.00 WS1
Store#46 5/14/2009 11:55:41 AM MMBAYO $40.00 WS1
If column A(Company), B(Load Date), and E(Amount) for record 35 in worksheet one, match the same columns for a record in worksheet two, both records are deleted/highlighted/marked with an x in an additional column/anything.
Alternately, I can combine the data in both worksheets into one large worksheet, if that would make the solution easier. And or adding a column that idenifies which record came from which report.
Basically I have two similar reports; each contain a few rows of transactions that the other does not, I need to separate the matching transactions from the unique transactions, in order to balance the two.
I have tried using the Remove Duplicates function but it saves one of the matching records (they should add an opiton to delete matching records aswell keeping only truly unique records), I dont understand how to work Conditional Formatting to get it to do what I want, I dont know macros, or vlookups.
View 9 Replies
View Related
Aug 1, 2007
I have four columns of info. Two are check #s and amounts from the bank and two are check #s and amounts from a database. How can I delete check #s(along with their amounts) that match? Is there any way to detect check numbers that match but amounts that don't?
View 5 Replies
View Related
Jun 11, 2013
I have made up 7 worksheets that are completely identical with exception of course to the data they contain. I have a master sheet that contains some of the data from each of the other sheets that will be shared between them. Things were working very well until I discovered that some data was duplicated on a couple of the sheets; and I am in need of adding more worksheets.
The formula I am using for this will not allow me to have more than the 7 worksheets. It is an IF statement array. So now I am wondering how will I be able to add these extra sheets. I would like to use my worksheet names in a range but have evidently done something wrong and could not get that to work before, ending up with this very long 'IF'. !Can worksheet names be used to create a named range?
Also, I would like to know if there is a way to prevent duplicate data on these sheets. I am using conditional formatting on each sheet now, but that of course only works on the current sheet.
View 4 Replies
View Related
Jun 24, 2006
Column A Column B
1 b
1 1
1 2
3 4
I need a macro that if value in column b matches with value in column a, delete it both the value in column b and a and put the deleted value into column c. now my value in my columns is a combination of numbers and letters and it can have this characteristic too: `2076 or `FI7890
View 3 Replies
View Related
May 11, 2007
I have been using the code found here
Sub DeleteRowsFastest()
Dim rTable As Range
Dim lCol As Long
Dim vCriteria
On Error Resume Next
'Determine the table range
With Selection
If .Cells.Count > 1 Then
Set rTable = Selection
Else.............................
to delete rows that match the given criteria. I am now wanting to do the opposite, keep the rows matching my given criteria and delete all others.
View 3 Replies
View Related
Jun 19, 2014
I have data that is on a separate .txt file (the source file) that resembles this;
A
B
C
D
E
F
1
Case
District
Pct
Division
Level1
Level2
2
305035
0
20
72
[Code] ..........
Using VBA from within the destination workbook, I would like to use an input box that allows the user to request/specify what numerical number (0 through 55) in Column B of the txt file (the source file) will be used to determine what data to copy to the destination file. The cells to copy to the destination file would be from Column A through Column G of the source file onto Sheet1, E2 of the destination file.
Column B of the Source file will only contain numbers. However there will be numerous identical numbers in Column B. All of which will need to be copied onto the destination workbook.
From the sample above, if the user were to enter '15' in the input box, the desired result on the destination sheet beginning at E2 would look like this;
E
F
G
H
I
J
1
Case
District
Pct
Division
Level1
Level2
2
502046
15
1
3
[Code] ............
View 9 Replies
View Related
Jul 8, 2009
Here is what Im trying to do: I have a VERY large excel file that has groups of 4 cells, a blank, then another 4, repeating. Kinda like the following:
ExampleCell1
ExampleCell2
ExampleCell3
UID = example
ExampleCell1
ExampleCell2
ExampleCell3
ExampleCell1
ExampleCell2
ExampleCell3
UID = example
That pattern continues for about 3000 lines. However, if you noticed, some of the "groups" dont have the 4th line "UID = example".
Here is what Im trying to do. I want excel to search for the cells with "UID" and DELETE it plus the 3 rows above. So that only the "groups" without the UID remain.
Now Im thinking this may be impossible, but I've seen some crazy things done with excel macros and was really hoping someone can help me out. Otherwise Im doing this manually for 3000+ lines of text.
View 7 Replies
View Related
Sep 12, 2008
I have a worksheet with 20,000 plus rows, header=yes, and I need to delete all rows NOT containing the numbers 6600, 6700 or 6800 in column C. I'm currently using the below code which works, but is DOG slow.
Sub TestDeleteRows()
Dim Firstrow As Long
Dim LastRow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
. ScreenUpdating = False
End With
View 5 Replies
View Related
Aug 20, 2006
in VBA, I would like to do the following:
Delete the entire row where any cell in that row is equal to cell "b15" in worksheet "Metal Type".
I would like it to run across all the worksheets hidden or unhidden, in the workbook, (except for worksheet "Metal Type").
If possible I would also like it to prompt the user to accept the contents of cell "b15" in worksheet "Metal Type" or enter a new string.
Also can it alert the user when "no matches were found"
View 9 Replies
View Related