Urgent-Urgent VBA LOOP

Urgent-Urgent VBA LOOP

Post by SmVmZ » Sat, 08 Oct 2005 01:46:04


Hello,

I need help to determine with thr VBA procedure below, I can to a loop to
evaluate each row in column C.
VBA Procedure

If VBPAWkbk.Worksheets("sheet1").Range("C2").Value = "SP" Then
Set CellToCheckForSP = VBPAWkbk.Worksheets("sheet1").Range("C2")
Else
Set CellToCheckForSP = VBPAWkbk.Worksheets("sheet1").Range("F99")
End If
If VBPAWkbk.Worksheets("sheet1").Range("C2").Value = "SP" Then
Set CellToCheckForSP = VBPAWkbk.Worksheets("sheet1").Range("C2")
Else
Set CellToCheckForSP = VBPAWkbk.Worksheets("sheet1").Range("F99")
End If
If VBPAWkbk.Worksheets("sheet1").Range("C2").Value = "SP" Then
Set CellWithValueToMatch = VBPAWkbk.Worksheets("sheet1").Range("A2")
Else
Set CellWithValueToMatch = VBPAWkbk.Worksheets("sheet1").Range("F2")
End If
With HeaderWks11
If (.Range("D4").Value) = CellWithValueToMatch Then
res = Application.VLookup(.Range("D4").Value, Lookup_Table_VBPA,
col_index_num, 0)
End If
HeaderWks11.Range("F3").Value = res
End With
--
Regards,
Jeff