Consulting

Results 1 to 2 of 2

Thread: Find Text String in Range then copy cell into another range

  1. #1

    Find Text String in Range then copy cell into another range

    Looking to get a bit of VBA to enable me to do this with one button click.

    I can understand VBA when its written - I just struggle to write it myself sometimes when it gets a bit more complex.

    Basically, I want to

    - search C59:C109
    - copy each cell that has "BAU" as part of the text string
    - paste each copied cell in sequence into C4:C28

    Seems simple ... .but I am drawing a blank. I can figure out bits and pieces of the code but cant combine them all

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Sub Test()
        Set r = Range("$C$58:$C$108")
        r.AutoFilter
        r.AutoFilter Field:=1, Criteria1:="=*BAU*"
        r.Offset(1).Copy Range("C4")
        r.AutoFilter
    End Sub
    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'

Posting Permissions

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