Consulting

Results 1 to 3 of 3

Thread: Solved: Copy found cell, not column

  1. #1
    VBAX Tutor
    Joined
    Jul 2009
    Posts
    207
    Location

    Solved: Copy found cell, not column

    Hello
    I have recorded this macro but am having difficulty copying the found cell to then paste elsewhere. My efforts only copy the whole column which is not what I need. The range H19 is always going to vary. Any help is always gratefully received.

    [vba]Sub Macro3()
    '
    Range("H1:H1000").Select
    Selection.Find(What:="1/", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False).Activate
    Range("H19").Select
    Selection.Copy
    Range("E3").Select
    ActiveSheet.Paste
    End Sub[/vba]

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA] Dim c As Range

    Set c = Range("H1:H1000").Find(What:="1/", LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
    False, SearchFormat:=False)

    c.Copy Range("E3")
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Tutor
    Joined
    Jul 2009
    Posts
    207
    Location
    mdmackillop
    Many thanks for your answer. Now tried and tested

    Gil

Posting Permissions

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