PDA

View Full Version : Find Text String in Range then copy cell into another range



hmltnangel
10-12-2017, 04:35 AM
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 https://www.mrexcel.com/forum/images/smilies/frown.png

mdmackillop
10-12-2017, 05:07 AM
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