Results 1 to 4 of 4

Thread: Find (XP)

  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Kitchener, Ontario, Canada
    Posts
    228
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find (XP)

    I am trying to find a value in a colum and copy it to another caal in a different worksheet. I have tried this but I think I am messing up on the ending somehow

    Sub Macro1()

    Const IstrCol = "M"
    Const IstrFirst = "Current Index"
    Dim IrngFirst As Range

    Set IrngFirst = Range(IstrCol & ":" & IstrCol).Find( _
    What:=IstrFirst, LookIn:=xlValues, LookAt:=xlPart)
    If IrngFirst Is Nothing Then
    MsgBox "Text not found.", vbExclamation
    Exit Sub
    End If

    Worksheets("Data - General info").Value(IngFirst).Copy Worksheets("Calculations").Range("A28")
    Set IrngFirst = Nothing


    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find (XP)

    In the line with the Copy method, you have IngFirst instead of IrngFirst, but it's not clear to me what you are trying to accomplish. The expression Worksheets("Data - General info").Value(IrngFirst) doesn't make sense to me. What exactly do you want to copy?

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Kitchener, Ontario, Canada
    Posts
    228
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find (XP)

    I am trying to copy the information in the cell that is found with the

    Set IrngFirst = Range(IstrCol & ":" & IstrCol).Find( _
    What:=IstrFirst, LookIn:=xlValues, LookAt:=xlPart)

    to
    Worksheets("Calculations").Range("A28")

    This was my attempt at changing the code you helped me with for finding a group of information.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find (XP)

    OK, try

    IrngFirst.Copy Worksheets("Calculations").Range("A28")

Posting Permissions

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