Consulting

Results 1 to 1 of 1

Thread: How to copy many values...comparing with smae values

  1. #1

    How to copy many values...comparing with smae values

    This code only to copy the values one time so if there are a another same value it will not copy them as it show in the pic1


    [vba]Dim myRange3 As Range
    Dim R As Long

    Dim cell As Range


    Set myRange3 = Worksheets(2).Range("A1:A100")

    For Each cell In myRange3
    If IsError(Application.Match(cell.Value, Sheets(3).Columns(1), 0)) Then
    R = Sheets(3).UsedRange.Rows.Count
    If R <> 1 Or Sheets(3).Range("A1").Value <> "" Then R = R + 1
    cell.Copy Sheets(3).Range("a" & R)
    End If
    Next cell





    [/vba]


    I want a new code to copy the four values in same row one time, and if there is one difference value at least it will print the four vlaues again. As it show in the pic2, where in the rwo 5 Tom,25,Green,Italy it's difference than Tom,25,Green,England are difference in Italy so it will copy . In the 6 and 7 rows are the same values as it in the 1 and 2 rwos.
    Last edited by Nader; 02-05-2008 at 05:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •