Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Location
    Wilcox, Saskatchewan
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    search for a value using a macro (xcel 2003)

    Post deleted by Seaner

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search for a value using a macro (xcel 2003)

    I am not completely clear from your question exactly what you want to do. For question 1., it looks like this line of code already copies the value in column AX to column L:

    <code>
    wshCur.Range("L" & lngRow) = wshTxt.Range("AX" & lngFoundRow)
    </code>


    if you are asking to also copy that value to column O, then just copy this line and change "L" to "O", like this:

    <code>
    wshCur.Range("O" & lngRow) = wshTxt.Range("AX" & lngFoundRow)
    </code>


    I think that the code below does what you are asking in question 2.

    <code>
    Set rng = wshTxt.Range("AZ65536").End(xlUp)
    If rng.Row >= lngFoundRow Then
    rng.Offset(0, -7).Copy Destination:=wshCur.Range("F" & lngRow)
    rng.Offset(0, -4).Copy Destination:=wshCur.Range("G" & lngRow)
    rng.Offset(0, 2).Copy Destination:=wshCur.Range("H" & lngRow)
    End If
    </code>
    Legare Coleman

Posting Permissions

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