Hey guys, I have another question, nerve-wracking for me, probably cake
for you.
I have two similiar spreadsheets with about 6,000 rows of data and a
bunch of columns. They're close, but not exact. Is there a way to match
the two up? Spreadsheet 1 and 2 look like this:100 100
200 200
300 400
400 500
500 600
600 700
700
800The common denominator would be the first row, let's say A1-A6000, with
a unique product code.
Basically, we have one master spreadsheet that was originally uploaded
to our SQL server, and then items were deleted manually on our web
interface because they were out of stock. I want to delete the items
that are in the master spreadsheet that don't exist in spreadsheet #2 -
so basically if an item isn't on spreadsheet 2, it deletes the entire
row in spreadsheet 1 so that at the end, there's an even number of rows
in each spreadsheet and they line up. Also, the columns don't match up
exactly in both spreadsheets - only the product codes are the same. Not
sure if that matters, really, but I figured I'd let you know.
Make any sense?
Just wanted to say thank you, you guys have been such a big help. Wish
I could give something back.--
method373
------------------------------------------------------------------------
method373's Profile: www.excelforum.com/member.php...oamp;userid=29888
View this thread: www.excelforum.com/showthread...hreadid=513934Try this in a command button:
Set rng1 = Range(quot;range1quot;)
Set rng2 = Range(quot;range2quot;)
rcnt1 = rng1.Rows.Count
rcnt2 = rng2.Rows.Count
For rc1 = 1 To rcnt1
foundit = False
For rc2 = 1 To rcnt2
If rng1.Cells(rc1, 1).Value = rng2.Cells(rc2, 1).Value
Then
foundit = True
GoTo nextrng1
End If
Next rc2
If Not foundit Then
' rng1.Cells(rc1, 2).Value = quot;deletequot;
rng1.Cells(rc1, 1).Delete shift:=xlShiftUp
rcnt1 = rcnt1 - 1
End If
nextrng1:
Next rc1
MsgBox (quot;done.quot;)But test it first!
HansHi Hans,
www.cpearson.com/excel/duplic...tingDuplicates
Several options down the page
--
Kind regards,
Niek Otten
quot;method373quot; gt; wrote
in message ...
gt;
gt; Hey guys, I have another question, nerve-wracking for me, probably cake
gt; for you.
gt;
gt; I have two similiar spreadsheets with about 6,000 rows of data and a
gt; bunch of columns. They're close, but not exact. Is there a way to match
gt; the two up? Spreadsheet 1 and 2 look like this:
gt;
gt;
gt; 100 100
gt; 200 200
gt; 300 400
gt; 400 500
gt; 500 600
gt; 600 700
gt; 700
gt; 800
gt;
gt;
gt; The common denominator would be the first row, let's say A1-A6000, with
gt; a unique product code.
gt;
gt; Basically, we have one master spreadsheet that was originally uploaded
gt; to our SQL server, and then items were deleted manually on our web
gt; interface because they were out of stock. I want to delete the items
gt; that are in the master spreadsheet that don't exist in spreadsheet #2 -
gt; so basically if an item isn't on spreadsheet 2, it deletes the entire
gt; row in spreadsheet 1 so that at the end, there's an even number of rows
gt; in each spreadsheet and they line up. Also, the columns don't match up
gt; exactly in both spreadsheets - only the product codes are the same. Not
gt; sure if that matters, really, but I figured I'd let you know.
gt;
gt; Make any sense?
gt;
gt; Just wanted to say thank you, you guys have been such a big help. Wish
gt; I could give something back.
gt;
gt;
gt; --
gt; method373
gt; ------------------------------------------------------------------------
gt; method373's Profile:
gt; www.excelforum.com/member.php...oamp;userid=29888
gt; View this thread: www.excelforum.com/showthread...hreadid=513934
gt;
- Apr 21 Sat 2007 20:36
Matching two spreadsheets
close
全站熱搜
留言列表
發表留言