Thread
:
Find something in column a then find if column B matches criteria
View Single Post
#
1
Posted to microsoft.public.excel.misc
Otto Moehrbach
external usenet poster
Posts: 1,090
Find something in column a then find if column B matches criteria
Darrell
Yes, it would be easier if you just email me what you have. My email
address is
. Remove the "nop" from this address. Tell
me what version of Excel you have. Otto
"Darrell_Sarrasin via OfficeKB.com" <u33691@uwe wrote in message
news:7be4f0106832f@uwe...
Is it possible to send you what I have to get assistance? or for you to
email
me this? I can not seem to figure it out.
Otto Moehrbach wrote:
Darrell
Now I have an idea of what you have and what you want. The following
macro will do what you want. As written, this macro works with 2 sheets
named "One" and "Two". Sheet "One" has the names in Column A starting in
A2
and the courses in Column B starting in B2. Sheet "Two" has the names in
Column A starting in A2 and the courses in row 1 starting in B1. Change
the
code as needed to work with your actual sheet names and data locations.
Watch out for line wrapping in this post. View this post in full screen.
HTH Otto
Sub CourseCompletion()
Dim rColAOne As Range, rColATwo As Range, rRow1Two As Range
Dim i As Range, TheRow As Long, TheCol As Long
Application.ScreenUpdating = False
Sheets("One").Select
Set rColAOne = Range("A2", Range("A" & Rows.Count).End(xlUp))
With Sheets("Two")
Set rColATwo = .Range("A2", .Range("A" &
Rows.Count).End(xlUp))
Set rRow1Two = .Range("B1", .Cells(1,
Columns.Count).End(xlToLeft))
For Each i In rColAOne
If Not IsEmpty(i.Offset(, 1).Value) Then
TheRow = rColATwo.Find(What:=i.Value,
LookAt:=xlWhole).Row
TheCol = rRow1Two.Find(What:=i.Offset(, 1).Value,
LookAt:=xlWhole).Column
.Cells(TheRow, TheCol).Value = "X"
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
hey otto. I dont believe I am getting my self across. currently what I
have
[quoted text clipped - 32 lines]
thanks a head of time.
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200711/1
Reply With Quote
Otto Moehrbach
View Public Profile
Find all posts by Otto Moehrbach