Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Macro to compare datas

Sub changeValues()
Const COLUMNB As String = "B"
Const COLUMND As String = "D"
Const COLUMNRESULTS = "E"

Dim iStartingRow As Long
Dim iLastRow As Long

iLastRow = Range(COLUMNB & Rows.Count).End(xlUp).Row
For iStartingRow = 2 To iLastRow
If Range(COLUMNB & iStartingRow).Value = Range(COLUMND &
iStartingRow).Value Then
Range(COLUMNRESULTS & iStartingRow).Value = "YES"
Else
Range(COLUMNRESULTS & iStartingRow).Value = "NO"
End If
Next
End Sub

"Dani Lima" wrote:

I need to compare a group of lines. On my worksheet there are lines with the
same number or order (colum B) (numericaly classified) and another colum (D)
with same datas, I need to compare if the number of the order are the same
and if the data on the columm d at the same line are the same, if so, the
macre should answer 'yes',if one of the datas on the columm d are different
the macro should answer 'no'.

Someone could help me?

regards, Dani

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
transfer datas into different sheet using macro? joana0907 Excel Discussion (Misc queries) 2 April 29th 09 09:45 AM
Trying to compare the datas... Astro Excel Worksheet Functions 1 April 13th 09 11:08 AM
Counting datas in one range based on datas in another range Irene Excel Discussion (Misc queries) 1 November 11th 08 11:51 PM
re : Finding the datas and deleting datas which are not found. ddiicc Excel Programming 7 August 30th 05 01:27 PM
Create a Worksheet by getting datas from the txt file with Macro Mansoor Ali Excel Programming 0 April 19th 05 10:01 AM


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