Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Searching for particular records

I am looking for a way to copy all the records from one spreadsheet to
another if a particular word (i.e. "rerun") is found anywhere in the
spreadsheet. What function would I use?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Searching for particular records

How about making a macro with code similar to the following:

Cells.Find(What:="rerun", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

You could incorporate this code with an OnError command that if the text
"rerun" is not found, the data is not copied.

Hope this helps
-Chad

" wrote:

I am looking for a way to copy all the records from one spreadsheet to
another if a particular word (i.e. "rerun") is found anywhere in the
spreadsheet. What function would I use?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Searching for particular records

Thanks Chad, but that is not working for me. It tells me the paste and copy
shapes are not the same size.

"Chad" wrote:

How about making a macro with code similar to the following:

Cells.Find(What:="rerun", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

You could incorporate this code with an OnError command that if the text
"rerun" is not found, the data is not copied.

Hope this helps
-Chad

" wrote:

I am looking for a way to copy all the records from one spreadsheet to
another if a particular word (i.e. "rerun") is found anywhere in the
spreadsheet. What function would I use?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Searching for particular records

are you utilizing this with other code or are you just copying and pasting
this in somewhere and running it? let me see the code you're using (if its
not too exhaustive). alternatively, try selecting a specific cell prior to
running this code, so the "focus" is not on a picture or shape or something.

" wrote:

Thanks Chad, but that is not working for me. It tells me the paste and copy
shapes are not the same size.

"Chad" wrote:

How about making a macro with code similar to the following:

Cells.Find(What:="rerun", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

You could incorporate this code with an OnError command that if the text
"rerun" is not found, the data is not copied.

Hope this helps
-Chad

" wrote:

I am looking for a way to copy all the records from one spreadsheet to
another if a particular word (i.e. "rerun") is found anywhere in the
spreadsheet. What function would I use?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Searching for particular records

I guess I will have to use Microsoft Access instead of Excel to build a
selection query with a "like" command. I was hoping Excel had something
similar.

"Chad" wrote:

How about making a macro with code similar to the following:

Cells.Find(What:="rerun", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

You could incorporate this code with an OnError command that if the text
"rerun" is not found, the data is not copied.

Hope this helps
-Chad

" wrote:

I am looking for a way to copy all the records from one spreadsheet to
another if a particular word (i.e. "rerun") is found anywhere in the
spreadsheet. What function would I use?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Searching for particular records

No, I'm not using it with other code. I just wanted to copy and paste those
records to another spreadsheet without having to find, copy and paste them
one at a time.

"Chad" wrote:

are you utilizing this with other code or are you just copying and pasting
this in somewhere and running it? let me see the code you're using (if its
not too exhaustive). alternatively, try selecting a specific cell prior to
running this code, so the "focus" is not on a picture or shape or something.

" wrote:

Thanks Chad, but that is not working for me. It tells me the paste and copy
shapes are not the same size.

"Chad" wrote:

How about making a macro with code similar to the following:

Cells.Find(What:="rerun", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

You could incorporate this code with an OnError command that if the text
"rerun" is not found, the data is not copied.

Hope this helps
-Chad

" wrote:

I am looking for a way to copy all the records from one spreadsheet to
another if a particular word (i.e. "rerun") is found anywhere in the
spreadsheet. What function would I use?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for #N/A [email protected] Excel Worksheet Functions 5 February 28th 07 01:23 PM
Searching, matching then searching another list based on the match A.S. Excel Discussion (Misc queries) 1 December 13th 06 05:08 AM
Searching for "?" Bill Ridgeway New Users to Excel 3 August 3rd 05 10:35 AM
searching Tracy A Excel Worksheet Functions 2 July 28th 05 08:54 PM
Searching the first name only Kelly Lim Excel Discussion (Misc queries) 7 June 17th 05 04:31 AM


All times are GMT +1. The time now is 11:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"