![]() |
#1
|
|||
|
|||
![]()
Can someone write a VBA code for this? I would like to search for something like "COMCAST" in column "A" of sheet 1 and have those rows appear in sheet 2. On the next search clear sheet 2 and copy the new search data over to sheet 2. I hope this makes sense.
Sample file is attached. Also, how do you mark a post as "SOLVED"? I look everywhere and can't find how to do it. Thanks everyone who responds. |
#2
|
||||
|
||||
![]()
To mark a thread solved click on "Thread Tools" and select as needed
For your other question Google around a bit this is a well known problem
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
![]() Quote:
Thanks Pecoflyer for your reply. When I click on "Thread Tools" all I get are the following 3 choices: 1. Show Printable Version 2. Unsubscribe from this Thread 3. Add a Poll to this Thread There is no SOLVED option available from my "Thread Tools" drop-down menu. I also tried tweaking around in my User Control Panel for a way to mark a post as SOLVED and still can't see how to do it. Is it possible someone else can mark this as SOLVED? |
#4
|
|||
|
|||
![]()
I found the solution to my question at the URL below:
http://www.mrexcel.com/forum/excel-q...worksheet.html It works well for my needs. Here's the code: Sub Test2() Dim myWord$ myWord = InputBox("What key word to copy rows", "Enter your word") If myWord = "" Then Exit Sub Application.ScreenUpdating = False Dim xRow&, NextRow&, LastRow& NextRow = 2 LastRow = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row For xRow = 1 To LastRow If WorksheetFunction.CountIf(Rows(xRow), "*" & myWord & "*") > 0 Then Rows(xRow).Copy Sheets("Sheet2").Rows(NextRow) NextRow = NextRow + 1 End If Next xRow Application.ScreenUpdating = True MsgBox "Macro is complete, " & NextRow - 2 & " rows containing" & vbCrLf & _ "''" & myWord & "''" & " were copied to Sheet2.", 64, "Done" End Sub |
![]() |
Tags |
vba code |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying to find a macro that will copy a cell and paste that value to a specific sheet | bryans88 | Excel Programming | 1 | 12-23-2015 01:40 PM |
Populate sheet 3 with data from sheet 1 and sheet 2 | speck | Excel Programming | 0 | 01-14-2015 07:54 AM |
![]() |
timomaha | Excel | 1 | 09-12-2014 07:51 AM |
![]() |
khalidfazeli | Excel | 2 | 02-06-2013 09:38 AM |
copy cell from sheet 2 to sheet 3 macro | slipperyjim | Excel Programming | 1 | 02-18-2010 01:31 AM |