Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Matching Colums & Rows in Different Spreadsheets
Hello again,
I need to compare a cell from one spreadsheet to another. Then if they match, copy information from the 1st spreadsheets column to the second spreadsheets row. I have this: With Sheets("Mississippi") lastCol = .Cells(1, "IV").End(xlToLeft).Column For i = lastCol To 1 Step -1 If Len(Trim(.Cells(1, i))) < 0 Then If Application.CountIf(Workbooks("Employee List for Payroll1") _ .Worksheets("List").Columns(6), .Cells(1, i)) = 0 Then .Columns(i).Delete .Columns(i + 1).Delete .Columns(i + 1).Delete .Columns(i).Delete ElseIf Application.CountIf(Workbooks("Employee List for Payroll1") _ .Worksheets("List").Columns(6), .Cells(1, i)) 0 Then Range(Cells(2, i), Cells(200, i + 1)).Select Selection.Delete xlShiftToLeft Range(Cells(1, i + 1), Cells(1, i + 2)).Select Selection.Delete xlShiftToLeft End If End If Next End With This works well at comparing, but does not tell me what the row is on the second sheet so I can copy info to it. It just keeps track of which row I am on, on the first and allows me to manipulate an entire row. Any help would be appreciated. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Matching two different colums, VLOOKUP? | Excel Discussion (Misc queries) | |||
Matching rows in 2 sheets and copying matching rows from sheet 1 t | Excel Programming | |||
copy row when matching colums found | Excel Programming | |||
Get matching values and formulas from ajoining colums of dropdown | Excel Discussion (Misc queries) | |||
Matching two spreadsheets | Excel Discussion (Misc queries) |