+ Reply to Thread
Results 1 to 2 of 2

Need to Search Column then Paste Data at end of Row? Advanced Filter?

  1. #1

    Need to Search Column then Paste Data at end of Row? Advanced Filter?

    Hi,
    I am going nowhere quick searching for this, so hopefully someone can
    help me.

    I have a sheet with "x" number of rows of data. I would like to search
    the second column for a specific string. Each time the string is
    found, I need to paste the value of variable "var1" and "var2" into
    column Q and R of that row. I would also like to know how many times
    the string was found at paste value into the first column of that row.

    I'm sure I could use a For loop to do this, but the data sheet can be
    very long and I was wondering if there was a better way to do this with
    the ".find()" or ".advancedfilter()" functions.

    Thanks,
    Logan


  2. #2
    dmthornton
    Guest

    RE: Need to Search Column then Paste Data at end of Row? Advanced Filt

    I'm glad I saw your posting. I never thought of using the advancedfilter
    function for something like this, but I think it could save time. I played
    arround with it and came up with this. I think if you tweek it, it should
    work.

    Selection.AutoFilter Field:=2, Criteria1:="FindThisString"
    Dim lngCount As Long
    lngCount = Range("B2",
    Range("B65536").End(xlUp)).SpecialCells(xlCellTypeVisible).Count 'lngCount
    will give you the totoal number of rows

    'Do for only the visible cells
    For Each c In Range("B2",
    Range("B65536").End(xlUp)).SpecialCells(xlCellTypeVisible)
    c.Offset(0, 15) = "new value"
    c.Offset(0, 16) = "new value"
    Next



    "[email protected]" wrote:

    > Hi,
    > I am going nowhere quick searching for this, so hopefully someone can
    > help me.
    >
    > I have a sheet with "x" number of rows of data. I would like to search
    > the second column for a specific string. Each time the string is
    > found, I need to paste the value of variable "var1" and "var2" into
    > column Q and R of that row. I would also like to know how many times
    > the string was found at paste value into the first column of that row.
    >
    > I'm sure I could use a For loop to do this, but the data sheet can be
    > very long and I was wondering if there was a better way to do this with
    > the ".find()" or ".advancedfilter()" functions.
    >
    > Thanks,
    > Logan
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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