Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-18-2016, 03:12 PM
Auto Auto is offline Find matching criterior in sheet 1 and copy to Sheet 2 Windows 8 Find matching criterior in sheet 1 and copy to Sheet 2 Office 2007
Novice
Find matching criterior in sheet 1 and copy to Sheet 2
 
Join Date: Mar 2016
Posts: 9
Auto is on a distinguished road
Question Find matching criterior in sheet 1 and copy to Sheet 2

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.
Attached Files
File Type: xlsx Totals.xlsx (35.5 KB, 12 views)
Reply With Quote
  #2  
Old 03-19-2016, 01:39 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Find matching criterior in sheet 1 and copy to Sheet 2 Windows 7 64bit Find matching criterior in sheet 1 and copy to Sheet 2 Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

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
__________________
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
Reply With Quote
  #3  
Old 03-19-2016, 11:56 AM
Auto Auto is offline Find matching criterior in sheet 1 and copy to Sheet 2 Windows 8 Find matching criterior in sheet 1 and copy to Sheet 2 Office 2007
Novice
Find matching criterior in sheet 1 and copy to Sheet 2
 
Join Date: Mar 2016
Posts: 9
Auto is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
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

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?
Reply With Quote
  #4  
Old 03-19-2016, 01:41 PM
Auto Auto is offline Find matching criterior in sheet 1 and copy to Sheet 2 Windows 8 Find matching criterior in sheet 1 and copy to Sheet 2 Office 2007
Novice
Find matching criterior in sheet 1 and copy to Sheet 2
 
Join Date: Mar 2016
Posts: 9
Auto is on a distinguished road
Default

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
Reply With Quote
Reply

Tags
vba code



Similar Threads
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
Find matching criterior in sheet 1 and copy to Sheet 2 matching data from one work sheet to another, then auto filling missing cell information timomaha Excel 1 09-12-2014 07:51 AM
Find matching criterior in sheet 1 and copy to Sheet 2 Find Results in excel copy the rows to another sheet 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:10 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft