+ Reply to Thread
Results 1 to 3 of 3

Search for a word in the column and copy it to another column on the same sheet

  1. #1
    Registered User
    Join Date
    08-07-2013
    Location
    Russia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question Search for a word in the column and copy it to another column on the same sheet

    Hi guys!

    I have an excel table with rows of data. The column J contains various descriptions of goods. I need to search all the rows in this column for the word LATEX and when it is found, copy ONLY this word to the column A on the same sheet on the same row. I was trying to find a solution and came up with this macro using Autofilter, but it is not working properly. Can you please help me?

    Sub FilterAndCopy()

    Dim dataWs As Worksheet
    Dim copyWs As Worksheet
    Dim totRows As Long
    Dim lastRow As Long

    Set dataWs = Worksheets("Massiv")
    Set copyWs = Worksheets("Massiv")

    With dataWs
    .AutoFilterMode = False
    With .Range("J:J")
    .AutoFilter Field:=1, Criteria1:="LATEX"
    End With
    End With

    totRows = dataWs.Range("J:J").Rows.count
    lastRow = dataWs.Range("J" & totRows).End(xlUp).Row
    dataWs.Range("J:J" & lastRow).Copy
    copyWs.Range("A6").PasteSpecial Paste:=xlPasteValues
    dataWs.AutoFilterMode = False

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Search for a word in the column and copy it to another column on the same sheet

    see attached file "ilnfernon 130807"
    this is macro enale workbook
    enable macro
    data is sheet1 . lsheet1 is copied to sheet 2 for preservig the data

    now try this macro (this is avilale in module of attched file but also repeated)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    I am not an expert. better solutions may be available
    [email protected]

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search for a word in the column and copy it to another column on the same sheet

    Another:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Search column for red Cell and copy row to sheet 2
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-25-2013, 09:52 AM
  2. VBA to enter a word, find said word in string of column & copy to another column
    By tuneloon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-29-2012, 11:59 AM
  3. Search Column Headers and Copy into a Sheet
    By ukguy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2012, 10:28 AM
  4. Search for Value in Closed Workbook and copy Column to Active Sheet Column BE
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-19-2011, 12:57 PM
  5. Search for column heading and copy column onto another sheet
    By chrismann85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2008, 05:53 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1