#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data check


Hi!
I would like to check, to see if the text in column "a" in this cod
exists in the range "data1" before proceeding on with the code. Thi
loop may involve several dozen rows only 3 or 4 of which will have dat
in column "k" but I want to verify that there is a valid name in colum
"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 Matlac
-----------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350
View this thread: http://www.excelforum.com/showthread.php?threadid=56121

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data check


Very Cool Tom!!!
Thanks alot!!!

--
Brian Matlac
-----------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350
View this thread: http://www.excelforum.com/showthread.php?threadid=56121

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
Need to do a data check - not sure the best way. cmjat Excel Worksheet Functions 1 May 29th 10 12:02 AM
How can I check/verify data in my Data Source for Pivot table? gayleh Excel Worksheet Functions 1 April 16th 08 08:30 PM
How can I check if data in an external data range is changed afte. Ruud Excel Worksheet Functions 0 January 7th 05 12:15 PM
How can I check if data in external data range is changed after re Ruud Excel Discussion (Misc queries) 0 January 7th 05 12:07 PM
data check Herb[_6_] Excel Programming 3 November 22nd 03 04:53 PM


All times are GMT +1. The time now is 02:13 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"