Thread: Data check
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Data check

Sheets("sheet1").Select
For i = 1 To Cells(Rows.Count, "k").End(xlUp).Row
If Cells(i, "k").Value < "" and application.Countif( _
Range("Data1"),Cells(i,"A")) 0 Then
Cells(i, "n").Value = Cells(i, "a").Value
Cells(i, "o").Value = Cells(i, "b").Value
Cells(i, "p").Value = Cells(i, "c").Value
End If
Next i

--
Regards,
Tom Ogilvy


"Brian Matlack" wrote:


Hi!
I would like to check, to see if the text in column "a" in this code
exists in the range "data1" before proceeding on with the code. This
loop may involve several dozen rows only 3 or 4 of which will have data
in column "k" but I want to verify that there is a valid name in column
"a" of that row before copying the data to another range.
<start code
Sheets("sheet1").Select
For i = 1 To Cells(Rows.Count, "k").End(xlUp).Row
If Cells(i, "k").Value < "" Then
Cells(i, "n").Value = Cells(i, "a").Value
Cells(i, "o").Value = Cells(i, "b").Value
Cells(i, "p").Value = Cells(i, "c").Value
End If
Next i
<end code
Hope someone can help stear me in the right direction!!
Thanks for your time!!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=561213