re: Intersection
I have a list of names in column C and a list of job codes in row 2, column E thru AF. The user enters the name of the person they are considering into cell B2 and then the job codes for that person into cells B3 up to B40. I would like a macro that scans the jobs codes entered in column B and, for each one, puts an X in the cell where the column that corresponds to the job code and the row that corresponds to the job name intersect.
So far I have the following:
I am not sure how to use the intersection method here... probably other problems also. Can anyone help with this?
I have a list of names in column C and a list of job codes in row 2, column E thru AF. The user enters the name of the person they are considering into cell B2 and then the job codes for that person into cells B3 up to B40. I would like a macro that scans the jobs codes entered in column B and, for each one, puts an X in the cell where the column that corresponds to the job code and the row that corresponds to the job name intersect.
So far I have the following:
Code:
Sub testJobs()
Application.ScreenUpdating = False
Dim personName As Variant, codeName As Variant, jobName As String, ff As String
Dim i As Integer, j As Integer, h As Integer, lastRow As Long
personName = UCase(Range("B1").Value)
With Sheets("CallList")
For h = 35 To 2 Step -1
If .Cells(h, 2).Value <> "" Then
codeNumber = .Cells(h, 2).Value
For i = 650 To 3 Step -1
If .Cells(i, 3).Value = personName Then
For j = 30 To 5 Step -1
If .Cells(j, 2).Value = codeNumber Then
Set isect = Application.Intersect(personName, codeNumber)
isect.Value ="X"
End If
Next j
End If
Next i
End If
Next h
End With
End Sub
I am not sure how to use the intersection method here... probably other problems also. Can anyone help with this?