Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matching two different colums, VLOOKUP? Freddie Excel Discussion (Misc queries) 4 August 27th 09 03:20 PM
Matching rows in 2 sheets and copying matching rows from sheet 1 t fbagirov Excel Programming 1 April 8th 07 03:44 PM
copy row when matching colums found lancastergeneral[_2_] Excel Programming 3 December 15th 06 11:11 PM
Get matching values and formulas from ajoining colums of dropdown Pete Elbert Excel Discussion (Misc queries) 1 March 18th 06 05:49 AM
Matching two spreadsheets method373 Excel Discussion (Misc queries) 2 February 18th 06 09:25 AM


All times are GMT +1. The time now is 09:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"