Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2014
    Posts
    3

    Unanswered: searching and adding missing lines

    Dears,

    I am developing a macro in which i have to search for a value, if it exists i skip it and if not i have to add the line at the end of the range.
    Already i have done the following, but it's not working since all the lines are copied!
    Any help please?
    If Trim(FindString) <> "" Then
    With Sheets("Checks to be printed (2)").Range("A:A")
    Set Rng = .Find(What:=FindString, _
    After:=.Cells(.Cells.Count), _
    LookIn:=xlValues, _
    LookAt:=xlWhole, _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlNext, _
    MatchCase:=False)
    If Not Rng Is Nothing Then

    Sheets("Checks to be printed (2)").Cells(lastline, 14).Value = Sheets("Checks to be printed (2)").Cells(2, 14).Text
    lastline = lastline + 1
    Else
    GoTo 0
    End If
    End With
    End If

    thank you

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Moved to Excel topic - you'll probably get better advice there
    George
    Home | Blog

  3. #3
    Join Date
    Mar 2014
    Posts
    3
    Thank you George.

Posting Permissions

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