How to repeat a lookup; copy & paste from 1 worksheet to another.
Could anyone assist on enabling the following code to: find multiple "text"
within a column (A:A) in sheet 1 (i.e. find all the letters "n" within column A:A within sheet 1) copy entire rows of each "n" find into sheet 2. Essentially repeating this command until all "n" are found and their corresponding EntireRow are copied from sheet 1 into sheet 2. I've had some success with the following, but, can not get it to deliver the desired end result. Again, any help would be greatly appreciated! FYI: I've set this up to run via a command button Sub Rectangle1_Click() Worksheets("Sheet1").Select With Worksheets("Sheet1").Range("a1:a20") Set c = .Find("NJ1S", LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.EntireRow.Copy Set c = .FindNext(c) Worksheets("Sheet2").Select Worksheets("Sheet2").Range("a8:a20").Find("").Sele ct Worksheets("Sheet2pplier Export").Paste Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub |
How to repeat a lookup; copy & paste from 1 worksheet to another.
Where line fails?
What results does it deliver? |
All times are GMT +1. The time now is 10:33 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com